Skip to main content

AddRateV1Body

Struct AddRateV1Body 

Source
pub struct AddRateV1Body {
Show 16 fields pub billing_frequency: Option<String>, pub commit_rate: Option<AddRateV1BodyCommitRate>, pub credit_type_id: Option<Uuid>, pub custom_rate: Map<String, Value>, pub ending_before: Option<DateTime<Utc>>, pub entitled: bool, pub is_prorated: Option<bool>, pub minimum_config: Option<AddRateV1BodyMinimumConfig>, pub price: Option<f64>, pub pricing_group_values: HashMap<String, String>, pub product_id: Uuid, pub quantity: Option<f64>, pub rate_card_id: Uuid, pub rate_type: String, pub starting_at: DateTime<Utc>, pub tiers: Vec<AddRateV1BodyTiersItem>,
}
Expand description

AddRateV1Body

JSON schema
{
 "type": "object",
 "required": [
   "entitled",
   "product_id",
   "rate_card_id",
   "rate_type",
   "starting_at"
 ],
 "properties": {
   "billing_frequency": {
     "description": "Optional. Frequency to bill subscriptions with.
Required for subscription type products with Flat rate.",
     "type": "string"
   },
   "commit_rate": {
     "description": "A distinct rate on the rate card. You can choose to use this rate rather than list rate when consuming a credit or commit.",
     "type": "object",
     "required": [
       "rate_type"
     ],
     "properties": {
       "minimum_config": {
         "description": "Only set for TIERED_PERCENTAGE or PERCENTAGE
rate_type. Any commit-specific overrides will not apply if there is a
minimum set on the rate/applied override.",
         "type": "object",
         "required": [
           "minimum"
         ],
         "properties": {
           "minimum": {
             "type": "number"
           }
         },
         "x-mint": {
           "groups": [
             "ff:support-charge-ga"
           ]
         },
         "x-stainless-skip": true
       },
       "price": {
         "description": "Commit rate price. For FLAT rate_type, this
must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g.
use 0.1 for 10%; this must be >=0 and <=1.",
         "type": "number"
       },
       "rate_type": {
         "type": "string",
         "x-mint-enum": {
           "CUSTOM": [
             "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
             "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
             "client_id:f157d376-0781-4ef3-9db9-775a9052148e",
             "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
             "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
             "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
             "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7"
           ],
           "PERCENTAGE": [
             "client_id:11db091c-975b-4908-9f67-b1ceb126acdf"
           ],
           "SUBSCRIPTION": [
             "client_id:11db091c-975b-4908-9f67-b1ceb126acdf"
           ],
           "TIERED_PERCENTAGE": [
             "ff:support-charge-ga"
           ],
           "custom": [
             "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
             "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
             "client_id:f157d376-0781-4ef3-9db9-775a9052148e",
             "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
             "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
             "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
             "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7"
           ],
           "percentage": [
             "client_id:11db091c-975b-4908-9f67-b1ceb126acdf"
           ],
           "subscription": [
             "client_id:11db091c-975b-4908-9f67-b1ceb126acdf"
           ],
           "tiered_percentage": [
             "ff:support-charge-ga"
           ]
         }
       },
       "tiers": {
         "description": "Only set for TIERED rate_type.",
         "type": "array",
         "items": {
           "type": "object",
           "required": [
             "price"
           ],
           "properties": {
             "price": {
               "type": "number"
             },
             "size": {
               "type": "number"
             }
           }
         }
       }
     }
   },
   "credit_type_id": {
     "description": "The Metronome ID of the credit type to associate
with price, defaults to USD (cents) if not passed. Used by all
rate_types except type PERCENTAGE. PERCENTAGE rates use the credit type
of associated rates.",
     "examples": [
       "2714e483-4ff1-48e4-9e25-ac732e8f24f2"
     ],
     "type": "string",
     "format": "uuid"
   },
   "custom_rate": {
     "description": "Only set for CUSTOM rate_type. This field is
interpreted by custom rate processors.",
     "type": "object",
     "additionalProperties": true,
     "x-mint": {
       "groups": [
         "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
         "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
         "client_id:f157d376-0781-4ef3-9db9-775a9052148e",
         "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
         "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
         "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
         "client_id:9c7e2b27-9b4c-4b76-9df7-f9cb05665a6a"
       ]
     }
   },
   "ending_before": {
     "description": "exclusive end date",
     "type": "string",
     "format": "date-time"
   },
   "entitled": {
     "type": "boolean"
   },
   "is_prorated": {
     "description": "Default proration configuration. Only valid for
SUBSCRIPTION rate_type. Must be set to true.",
     "type": "boolean",
     "x-mint": {
       "groups": [
         "ff:legacy-subscriptions-enabled"
       ]
     }
   },
   "minimum_config": {
     "description": "Only set for TIERED_PERCENTAGE or PERCENTAGE
rate_type. Any commit-specific overrides will not apply if there is a
minimum set on the rate/applied override.",
     "type": "object",
     "required": [
       "minimum"
     ],
     "properties": {
       "minimum": {
         "type": "number"
       }
     },
     "x-mint": {
       "groups": [
         "ff:support-charge-ga"
       ]
     },
     "x-stainless-skip": true
   },
   "price": {
     "description": "Default price. For FLAT and SUBSCRIPTION rate_type,
this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction,
e.g. use 0.1 for 10%; this must be >=0 and <=1.",
     "type": "number"
   },
   "pricing_group_values": {
     "description": "Optional. List of pricing group key value pairs
which will be used to calculate the price.",
     "type": "object",
     "additionalProperties": {
       "type": "string"
     }
   },
   "product_id": {
     "description": "ID of the product to add a rate for",
     "type": "string",
     "format": "uuid"
   },
   "quantity": {
     "description": "Default quantity. For SUBSCRIPTION rate_type, this
must be >=0.",
     "type": "number",
     "x-mint": {
       "groups": [
         "ff:legacy-subscriptions-enabled"
       ]
     }
   },
   "rate_card_id": {
     "description": "ID of the rate card to update",
     "type": "string",
     "format": "uuid"
   },
   "rate_type": {
     "type": "string",
     "x-mint-enum": {
       "CUSTOM": [
         "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
         "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
         "client_id:f157d376-0781-4ef3-9db9-775a9052148e",
         "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
         "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
         "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
         "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7"
       ],
       "SUBSCRIPTION": [
         "ff:legacy-subscriptions-enabled"
       ],
       "TIERED_PERCENTAGE": [
         "ff:support-charge-ga"
       ],
       "custom": [
         "client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
         "client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
         "client_id:f157d376-0781-4ef3-9db9-775a9052148e",
         "client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
         "client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
         "client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
         "client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7"
       ],
       "subscription": [
         "ff:legacy-subscriptions-enabled"
       ],
       "tiered_percentage": [
         "ff:support-charge-ga"
       ]
     }
   },
   "starting_at": {
     "description": "inclusive effective date",
     "type": "string",
     "format": "date-time"
   },
   "tiers": {
     "description": "Only set for TIERED rate_type.",
     "type": "array",
     "items": {
       "type": "object",
       "required": [
         "price"
       ],
       "properties": {
         "price": {
           "type": "number"
         },
         "size": {
           "type": "number"
         }
       }
     }
   }
 }
}

Fields§

§billing_frequency: Option<String>

Optional. Frequency to bill subscriptions with. Required for subscription type products with Flat rate.

§commit_rate: Option<AddRateV1BodyCommitRate>§credit_type_id: Option<Uuid>

The Metronome ID of the credit type to associate with price, defaults to USD (cents) if not passed. Used by all rate_types except type PERCENTAGE. PERCENTAGE rates use the credit type of associated rates.

§custom_rate: Map<String, Value>

Only set for CUSTOM rate_type. This field is interpreted by custom rate processors.

§ending_before: Option<DateTime<Utc>>

exclusive end date

§entitled: bool§is_prorated: Option<bool>

Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true.

§minimum_config: Option<AddRateV1BodyMinimumConfig>§price: Option<f64>

Default price. For FLAT and SUBSCRIPTION rate_type, this must be

=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.

§pricing_group_values: HashMap<String, String>

Optional. List of pricing group key value pairs which will be used to calculate the price.

§product_id: Uuid

ID of the product to add a rate for

§quantity: Option<f64>

Default quantity. For SUBSCRIPTION rate_type, this must be >=0.

§rate_card_id: Uuid

ID of the rate card to update

§rate_type: String§starting_at: DateTime<Utc>

inclusive effective date

§tiers: Vec<AddRateV1BodyTiersItem>

Only set for TIERED rate_type.

Trait Implementations§

Source§

impl Clone for AddRateV1Body

Source§

fn clone(&self) -> AddRateV1Body

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AddRateV1Body

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AddRateV1Body

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AddRateV1Body

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more