Class: MetronomeSDK::Models::V1::AlertCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/metronome_sdk/models/v1/alert_create_params.rb

Overview

Defined Under Namespace

Modules: AlertType Classes: CustomFieldFilter, GroupValue

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(alert_type: , name: , threshold: , billable_metric_id: nil, credit_grant_type_filters: nil, credit_type_id: nil, custom_field_filters: nil, customer_id: nil, evaluate_on_create: nil, group_values: nil, invoice_types_filter: nil, plan_id: nil, uniqueness_key: nil, request_options: {}) ⇒ Object

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

Parameters:

  • alert_type (Symbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType) (defaults to: )

    Type of the threshold notification

  • name (String) (defaults to: )

    Name of the threshold notification

  • threshold (Float) (defaults to: )

    Threshold value of the notification policy. Depending upon the notification typ

  • billable_metric_id (String) (defaults to: nil)

    For threshold notifications of type ‘usage_threshold_reached`, specifies which b

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

    An array of strings, representing a way to filter the credit grant this threshol

  • credit_type_id (String) (defaults to: nil)

    ID of the credit’s currency, defaults to USD. If the specific notification type

  • custom_field_filters (Array<MetronomeSDK::Models::V1::AlertCreateParams::CustomFieldFilter>) (defaults to: nil)

    A list of custom field filters for threshold notification types that support adv

  • customer_id (String) (defaults to: nil)

    If provided, will create this threshold notification for this specific customer.

  • evaluate_on_create (Boolean) (defaults to: nil)

    If true, the threshold notification will evaluate immediately on customers that

  • group_values (Array<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>) (defaults to: nil)

    Only present for ‘spend_threshold_reached` notifications. Scope notification to

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

    Only supported for invoice_total_reached threshold notifications. A list of invo

  • plan_id (String) (defaults to: nil)

    If provided, will create this threshold notification for this specific plan. To

  • uniqueness_key (String) (defaults to: nil)

    Prevents the creation of duplicates. If a request to create a record is made wit

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


# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 108

Instance Attribute Details

#alert_typeSymbol, MetronomeSDK::Models::V1::AlertCreateParams::AlertType

Type of the threshold notification



15
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 15

required :alert_type, enum: -> { MetronomeSDK::V1::AlertCreateParams::AlertType }

#billable_metric_idString?

For threshold notifications of type ‘usage_threshold_reached`, specifies which billable metric to track the usage for.

Returns:

  • (String, nil)


36
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 36

optional :billable_metric_id, String

#credit_grant_type_filtersArray<String>?

An array of strings, representing a way to filter the credit grant this threshold notification applies to, by looking at the credit_grant_type field on the credit grant. This field is only defined for CreditPercentage and CreditBalance notifications

Returns:

  • (Array<String>, nil)


45
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 45

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

#credit_type_idString?

ID of the credit’s currency, defaults to USD. If the specific notification type requires a pricing unit/currency, find the ID in the [Metronome app](app.metronome.com/offering/pricing-units).

Returns:

  • (String, nil)


53
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 53

optional :credit_type_id, String

#custom_field_filtersArray<MetronomeSDK::Models::V1::AlertCreateParams::CustomFieldFilter>?

A list of custom field filters for threshold notification types that support advanced filtering. Only present for contract invoices.



60
61
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 60

optional :custom_field_filters,
-> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::AlertCreateParams::CustomFieldFilter] }

#customer_idString?

If provided, will create this threshold notification for this specific customer. To create a notification for all customers, do not specify a ‘customer_id`.

Returns:

  • (String, nil)


68
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 68

optional :customer_id, String

#evaluate_on_createBoolean?

If true, the threshold notification will evaluate immediately on customers that already meet the notification threshold. If false, it will only evaluate on future customers that trigger the threshold. Defaults to true.

Returns:

  • (Boolean, nil)


76
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 76

optional :evaluate_on_create, MetronomeSDK::Internal::Type::Boolean

#group_valuesArray<MetronomeSDK::Models::V1::AlertCreateParams::GroupValue>?

Only present for ‘spend_threshold_reached` notifications. Scope notification to a specific group key on individual line items.



83
84
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 83

optional :group_values,
-> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::AlertCreateParams::GroupValue] }

#invoice_types_filterArray<String>?

Only supported for invoice_total_reached threshold notifications. A list of invoice types to evaluate.

Returns:

  • (Array<String>, nil)


91
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 91

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

#nameString

Name of the threshold notification

Returns:

  • (String)


21
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 21

required :name, String

#plan_idString?

If provided, will create this threshold notification for this specific plan. To create a notification for all customers, do not specify a ‘plan_id`.

Returns:

  • (String, nil)


98
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 98

optional :plan_id, String

#thresholdFloat

Threshold value of the notification policy. Depending upon the notification type, this number may represent a financial amount, the days remaining, or a percentage reached.

Returns:

  • (Float)


29
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 29

required :threshold, Float

#uniqueness_keyString?

Prevents the creation of duplicates. If a request to create a record is made with a previously used uniqueness key, a new record will not be created and the request will fail with a 409 error.

Returns:

  • (String, nil)


106
# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 106

optional :uniqueness_key, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/metronome_sdk/models/v1/alert_create_params.rb', line 161