Class: MetronomeSDK::Models::V1::PackageListResponse::Commit

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

Defined Under Namespace

Modules: RateType, Type Classes: AccessSchedule, InvoiceSchedule, Product

Instance Attribute Summary collapse

Class Method 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(id:, name:) ⇒ Object

Parameters:

  • id (String)
  • name (String)


212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 212

class Commit < MetronomeSDK::Internal::Type::BaseModel
  # @!attribute id
  #
  #   @return [String]
  required :id, String

  # @!attribute product
  #
  #   @return [MetronomeSDK::Models::V1::PackageListResponse::Commit::Product]
  required :product, -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::Product }

  # @!attribute type
  #
  #   @return [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::Type]
  required :type, enum: -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::Type }

  # @!attribute access_schedule
  #   The schedule that the customer will gain access to the credits purposed with
  #   this commit.
  #
  #   @return [MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule, nil]
  optional :access_schedule, -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule }

  # @!attribute applicable_product_ids
  #
  #   @return [Array<String>, nil]
  optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]

  # @!attribute applicable_product_tags
  #
  #   @return [Array<String>, nil]
  optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]

  # @!attribute custom_fields
  #   Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
  #
  #   @return [Hash{Symbol=>String}, nil]
  optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]

  # @!attribute description
  #
  #   @return [String, nil]
  optional :description, String

  # @!attribute invoice_schedule
  #   The schedule that the customer will be invoiced for this commit.
  #
  #   @return [MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule, nil]
  optional :invoice_schedule, -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule }

  # @!attribute name
  #
  #   @return [String, nil]
  optional :name, String

  # @!attribute priority
  #   If multiple credits or commits are applicable, the one with the lower priority
  #   will apply first.
  #
  #   @return [Float, nil]
  optional :priority, Float

  # @!attribute rate_type
  #
  #   @return [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::RateType, nil]
  optional :rate_type, enum: -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::RateType }

  # @!attribute rollover_fraction
  #
  #   @return [Float, nil]
  optional :rollover_fraction, Float

  # @!attribute specifiers
  #   List of filters that determine what kind of customer usage draws down a commit
  #   or credit. A customer's usage needs to meet the condition of at least one of the
  #   specifiers to contribute to a commit's or credit's drawdown.
  #
  #   @return [Array<MetronomeSDK::Models::CommitSpecifier>, nil]
  optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }

  # @!method initialize(id:, product:, type:, access_schedule: nil, applicable_product_ids: nil, applicable_product_tags: nil, custom_fields: nil, description: nil, invoice_schedule: nil, name: nil, priority: nil, rate_type: nil, rollover_fraction: nil, specifiers: nil)
  #   Some parameter documentations has been truncated, see
  #   {MetronomeSDK::Models::V1::PackageListResponse::Commit} for more details.
  #
  #   @param id [String]
  #
  #   @param product [MetronomeSDK::Models::V1::PackageListResponse::Commit::Product]
  #
  #   @param type [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::Type]
  #
  #   @param access_schedule [MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule] The schedule that the customer will gain access to the credits purposed with thi
  #
  #   @param applicable_product_ids [Array<String>]
  #
  #   @param applicable_product_tags [Array<String>]
  #
  #   @param custom_fields [Hash{Symbol=>String}] Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
  #
  #   @param description [String]
  #
  #   @param invoice_schedule [MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule] The schedule that the customer will be invoiced for this commit.
  #
  #   @param name [String]
  #
  #   @param priority [Float] If multiple credits or commits are applicable, the one with the lower priority w
  #
  #   @param rate_type [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::RateType]
  #
  #   @param rollover_fraction [Float]
  #
  #   @param specifiers [Array<MetronomeSDK::Models::CommitSpecifier>] List of filters that determine what kind of customer usage draws down a commit o

  # @see MetronomeSDK::Models::V1::PackageListResponse::Commit#product
  class Product < MetronomeSDK::Internal::Type::BaseModel
    # @!attribute id
    #
    #   @return [String]
    required :id, String

    # @!attribute name
    #
    #   @return [String]
    required :name, String

    # @!method initialize(id:, name:)
    #   @param id [String]
    #   @param name [String]
  end

  # @see MetronomeSDK::Models::V1::PackageListResponse::Commit#type
  module Type
    extend MetronomeSDK::Internal::Type::Enum

    PREPAID = :PREPAID
    POSTPAID = :POSTPAID

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # @see MetronomeSDK::Models::V1::PackageListResponse::Commit#access_schedule
  class AccessSchedule < MetronomeSDK::Internal::Type::BaseModel
    # @!attribute credit_type
    #
    #   @return [MetronomeSDK::Models::CreditTypeData]
    required :credit_type, -> { MetronomeSDK::CreditTypeData }

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

    # @!method initialize(credit_type:, schedule_items:)
    #   The schedule that the customer will gain access to the credits purposed with
    #   this commit.
    #
    #   @param credit_type [MetronomeSDK::Models::CreditTypeData]
    #   @param schedule_items [Array<MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem>]

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

      # @!attribute amount
      #
      #   @return [Float]
      required :amount, Float

      # @!attribute duration
      #
      #   @return [MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::Duration]
      required :duration,
               -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::Duration }

      # @!attribute starting_at_offset
      #
      #   @return [MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::StartingAtOffset]
      required :starting_at_offset,
               -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::StartingAtOffset }

      # @!method initialize(id:, amount:, duration:, starting_at_offset:)
      #   @param id [String]
      #   @param amount [Float]
      #   @param duration [MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::Duration]
      #   @param starting_at_offset [MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::StartingAtOffset]

      # @see MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem#duration
      class Duration < MetronomeSDK::Internal::Type::BaseModel
        # @!attribute unit
        #
        #   @return [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::Duration::Unit]
        required :unit,
                 enum: -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::Duration::Unit }

        # @!attribute value
        #
        #   @return [Integer]
        required :value, Integer

        # @!method initialize(unit:, value:)
        #   @param unit [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::Duration::Unit]
        #   @param value [Integer]

        # @see MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::Duration#unit
        module Unit
          extend MetronomeSDK::Internal::Type::Enum

          DAYS = :DAYS
          WEEKS = :WEEKS
          MONTHS = :MONTHS
          YEARS = :YEARS

          # @!method self.values
          #   @return [Array<Symbol>]
        end
      end

      # @see MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem#starting_at_offset
      class StartingAtOffset < MetronomeSDK::Internal::Type::BaseModel
        # @!attribute unit
        #
        #   @return [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::StartingAtOffset::Unit]
        required :unit,
                 enum: -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::StartingAtOffset::Unit }

        # @!attribute value
        #
        #   @return [Integer]
        required :value, Integer

        # @!method initialize(unit:, value:)
        #   @param unit [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::StartingAtOffset::Unit]
        #   @param value [Integer]

        # @see MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule::ScheduleItem::StartingAtOffset#unit
        module Unit
          extend MetronomeSDK::Internal::Type::Enum

          DAYS = :DAYS
          WEEKS = :WEEKS
          MONTHS = :MONTHS
          YEARS = :YEARS

          # @!method self.values
          #   @return [Array<Symbol>]
        end
      end
    end
  end

  # @see MetronomeSDK::Models::V1::PackageListResponse::Commit#invoice_schedule
  class InvoiceSchedule < MetronomeSDK::Internal::Type::BaseModel
    # @!attribute credit_type
    #
    #   @return [MetronomeSDK::Models::CreditTypeData]
    required :credit_type, -> { MetronomeSDK::CreditTypeData }

    # @!attribute do_not_invoice
    #   If true, this schedule will not generate an invoice.
    #
    #   @return [Boolean]
    required :do_not_invoice, MetronomeSDK::Internal::Type::Boolean

    # @!attribute schedule_items
    #
    #   @return [Array<MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem>]
    required :schedule_items,
             -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem] }

    # @!method initialize(credit_type:, do_not_invoice:, schedule_items:)
    #   The schedule that the customer will be invoiced for this commit.
    #
    #   @param credit_type [MetronomeSDK::Models::CreditTypeData]
    #
    #   @param do_not_invoice [Boolean] If true, this schedule will not generate an invoice.
    #
    #   @param schedule_items [Array<MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem>]

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

      # @!attribute date_offset
      #
      #   @return [MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem::DateOffset]
      required :date_offset,
               -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem::DateOffset }

      # @!attribute quantity
      #
      #   @return [Float]
      required :quantity, Float

      # @!attribute unit_price
      #
      #   @return [Float]
      required :unit_price, Float

      # @!method initialize(id:, date_offset:, quantity:, unit_price:)
      #   @param id [String]
      #   @param date_offset [MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem::DateOffset]
      #   @param quantity [Float]
      #   @param unit_price [Float]

      # @see MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem#date_offset
      class DateOffset < MetronomeSDK::Internal::Type::BaseModel
        # @!attribute unit
        #
        #   @return [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem::DateOffset::Unit]
        required :unit,
                 enum: -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem::DateOffset::Unit }

        # @!attribute value
        #
        #   @return [Integer]
        required :value, Integer

        # @!method initialize(unit:, value:)
        #   @param unit [Symbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem::DateOffset::Unit]
        #   @param value [Integer]

        # @see MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule::ScheduleItem::DateOffset#unit
        module Unit
          extend MetronomeSDK::Internal::Type::Enum

          DAYS = :DAYS
          WEEKS = :WEEKS
          MONTHS = :MONTHS
          YEARS = :YEARS

          # @!method self.values
          #   @return [Array<Symbol>]
        end
      end
    end
  end

  # @see MetronomeSDK::Models::V1::PackageListResponse::Commit#rate_type
  module RateType
    extend MetronomeSDK::Internal::Type::Enum

    COMMIT_RATE = :COMMIT_RATE
    LIST_RATE = :LIST_RATE

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#access_scheduleMetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule?

The schedule that the customer will gain access to the credits purposed with this commit.



233
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 233

optional :access_schedule, -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::AccessSchedule }

#applicable_product_idsArray<String>?

Returns:

  • (Array<String>, nil)


238
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 238

optional :applicable_product_ids, MetronomeSDK::Internal::Type::ArrayOf[String]

#applicable_product_tagsArray<String>?

Returns:

  • (Array<String>, nil)


243
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 243

optional :applicable_product_tags, MetronomeSDK::Internal::Type::ArrayOf[String]

#custom_fieldsHash{Symbol=>String}?

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

Returns:

  • (Hash{Symbol=>String}, nil)


249
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 249

optional :custom_fields, MetronomeSDK::Internal::Type::HashOf[String]

#descriptionString?

Returns:

  • (String, nil)


254
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 254

optional :description, String

#idString

Returns:

  • (String)


216
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 216

required :id, String

#invoice_scheduleMetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule?

The schedule that the customer will be invoiced for this commit.



260
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 260

optional :invoice_schedule, -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::InvoiceSchedule }

#nameString?

Returns:

  • (String, nil)


265
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 265

optional :name, String

#priorityFloat?

If multiple credits or commits are applicable, the one with the lower priority will apply first.

Returns:

  • (Float, nil)


272
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 272

optional :priority, Float

#productMetronomeSDK::Models::V1::PackageListResponse::Commit::Product



221
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 221

required :product, -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::Product }

#rate_typeSymbol, ...



277
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 277

optional :rate_type, enum: -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::RateType }

#rollover_fractionFloat?

Returns:

  • (Float, nil)


282
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 282

optional :rollover_fraction, Float

#specifiersArray<MetronomeSDK::Models::CommitSpecifier>?

List of filters that determine what kind of customer usage draws down a commit or credit. A customer’s usage needs to meet the condition of at least one of the specifiers to contribute to a commit’s or credit’s drawdown.

Returns:



290
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 290

optional :specifiers, -> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::CommitSpecifier] }

#typeSymbol, MetronomeSDK::Models::V1::PackageListResponse::Commit::Type



226
# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 226

required :type, enum: -> { MetronomeSDK::Models::V1::PackageListResponse::Commit::Type }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/metronome_sdk/models/v1/package_list_response.rb', line 348