Skip to main content

CreateCustomerCommitV1Body

Struct CreateCustomerCommitV1Body 

Source
pub struct CreateCustomerCommitV1Body {
Show 18 fields pub access_schedule: CreateCustomerCommitV1BodyAccessSchedule, pub applicable_contract_ids: Vec<String>, pub applicable_product_ids: Vec<Uuid>, pub applicable_product_tags: Vec<String>, pub custom_fields: HashMap<String, String>, pub customer_id: Uuid, pub description: Option<String>, pub invoice_contract_id: Option<Uuid>, pub invoice_schedule: Option<CreateCustomerCommitV1BodyInvoiceSchedule>, pub name: Option<CreateCustomerCommitV1BodyName>, pub netsuite_sales_order_id: Option<String>, pub priority: f64, pub product_id: Uuid, pub rate_type: Option<String>, pub salesforce_opportunity_id: Option<String>, pub specifiers: Vec<CreateCustomerCommitV1BodySpecifiersItem>, pub type_: String, pub uniqueness_key: Option<CreateCustomerCommitV1BodyUniquenessKey>,
}
Expand description

CreateCustomerCommitV1Body

JSON schema
{
 "type": "object",
 "required": [
   "access_schedule",
   "customer_id",
   "priority",
   "product_id",
   "type"
 ],
 "properties": {
   "access_schedule": {
     "description": "Schedule for distributing the commit to the
customer. For \"POSTPAID\" commits only one schedule item is allowed and
amount must match invoice_schedule total.",
     "type": "object",
     "required": [
       "schedule_items"
     ],
     "properties": {
       "credit_type_id": {
         "description": "Defaults to USD (cents) if not passed",
         "type": "string",
         "format": "uuid"
       },
       "schedule_items": {
         "type": "array",
         "items": {
           "type": "object",
           "required": [
             "amount",
             "ending_before",
             "starting_at"
           ],
           "properties": {
             "amount": {
               "type": "number"
             },
             "ending_before": {
               "description": "RFC 3339 timestamp (exclusive)",
               "type": "string",
               "format": "date-time"
             },
             "starting_at": {
               "description": "RFC 3339 timestamp (inclusive)",
               "type": "string",
               "format": "date-time"
             }
           }
         }
       }
     }
   },
   "applicable_contract_ids": {
     "description": "Which contract the commit applies to. If not
provided, the commit applies to all contracts.",
     "type": "array",
     "items": {
       "type": "string"
     }
   },
   "applicable_product_ids": {
     "description": "Which products the commit applies to. If
applicable_product_ids, applicable_product_tags or specifiers are not
provided, the commit applies to all products.",
     "type": "array",
     "items": {
       "type": "string",
       "format": "uuid"
     }
   },
   "applicable_product_tags": {
     "description": "Which tags the commit applies to. If
applicable_product_ids, applicable_product_tags or specifiers are not
provided, the commit applies to all products.",
     "type": "array",
     "items": {
       "type": "string"
     }
   },
   "custom_fields": {
     "description": "Custom fields to be added eg. { \"key1\":
\"value1\", \"key2\": \"value2\" }",
     "type": "object",
     "additionalProperties": {
       "type": "string"
     },
     "x-cf-entity": "commit"
   },
   "customer_id": {
     "type": "string",
     "format": "uuid"
   },
   "description": {
     "description": "Used only in UI/API. It is not exposed to end
customers.",
     "type": "string"
   },
   "invoice_contract_id": {
     "description": "The contract that this commit will be billed on.
This is required for \"POSTPAID\" commits and for \"PREPAID\" commits
unless there is no invoice schedule above (i.e., the commit is 'free'),
or if do_not_invoice is set to true.",
     "type": "string",
     "format": "uuid"
   },
   "invoice_schedule": {
     "description": "Required for \"POSTPAID\" commits: the true up
invoice will be generated at this time and only one schedule item is
allowed; the total must match accesss_schedule amount. Optional for
\"PREPAID\" commits: if not provided, this will be a \"complimentary\"
commit with no invoice.",
     "type": "object",
     "properties": {
       "credit_type_id": {
         "description": "Defaults to USD (cents) if not passed.",
         "type": "string",
         "format": "uuid"
       },
       "do_not_invoice": {
         "description": "This field is only applicable to commit invoice
schedules. If true, this schedule will not generate an invoice.",
         "default": false,
         "type": "boolean"
       },
       "recurring_schedule": {
         "description": "Enter the unit price and quantity for the charge or instead only send the amount. If amount is sent, the unit price is assumed to be the amount and quantity is inferred to be 1.",
         "type": "object",
         "required": [
           "amount_distribution",
           "ending_before",
           "frequency",
           "starting_at"
         ],
         "properties": {
           "amount": {
             "description": "Amount for the charge. Can be provided
instead of unit_price and quantity. If amount is sent, the unit_price is
assumed to be the amount and quantity is inferred to be 1.",
             "type": "number"
           },
           "amount_distribution": {
             "type": "string"
           },
           "ending_before": {
             "description": "RFC 3339 timestamp (exclusive).",
             "type": "string",
             "format": "date-time"
           },
           "frequency": {
             "type": "string"
           },
           "quantity": {
             "description": "Quantity for the charge. Will be multiplied
by unit_price to determine the amount and must be specified with
unit_price. If specified amount cannot be provided.",
             "type": "number"
           },
           "starting_at": {
             "description": "RFC 3339 timestamp (inclusive).",
             "type": "string",
             "format": "date-time"
           },
           "unit_price": {
             "description": "Unit price for the charge. Will be
multiplied by quantity to determine the amount and must be specified
with quantity. If specified amount cannot be provided.",
             "type": "number"
           }
         }
       },
       "schedule_items": {
         "description": "Either provide amount or provide both
unit_price and quantity.",
         "type": "array",
         "items": {
           "type": "object",
           "required": [
             "timestamp"
           ],
           "properties": {
             "amount": {
               "description": "Amount for the charge. Can be provided
instead of unit_price and quantity. If amount is sent, the unit_price is
assumed to be the amount and quantity is inferred to be 1.",
               "type": "number"
             },
             "quantity": {
               "description": "Quantity for the charge. Will be
multiplied by unit_price to determine the amount and must be specified
with unit_price. If specified amount cannot be provided.",
               "type": "number"
             },
             "timestamp": {
               "description": "timestamp of the scheduled event",
               "type": "string",
               "format": "date-time"
             },
             "unit_price": {
               "description": "Unit price for the charge. Will be
multiplied by quantity to determine the amount and must be specified
with quantity. If specified amount cannot be provided.",
               "type": "number"
             }
           }
         }
       }
     }
   },
   "name": {
     "description": "displayed on invoices",
     "type": "string",
     "minLength": 1
   },
   "netsuite_sales_order_id": {
     "description": "This field's availability is dependent on your
client's configuration.",
     "type": "string",
     "x-mint": {
       "groups": [
         "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2"
       ]
     }
   },
   "priority": {
     "description": "If multiple credits or commits are applicable, the
one with the lower priority will apply first.",
     "type": "number"
   },
   "product_id": {
     "description": "ID of the fixed product associated with the commit.
This is required because products are used to invoice the commit
amount.",
     "type": "string",
     "format": "uuid"
   },
   "rate_type": {
     "type": "string"
   },
   "salesforce_opportunity_id": {
     "description": "This field's availability is dependent on your
client's configuration.",
     "type": "string",
     "x-mint": {
       "groups": [
         "client_id:e3147d6d-4101-4cd1-9888-ce3afeeac5b2"
       ]
     }
   },
   "specifiers": {
     "description": "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. This field cannot be used together with
`applicable_product_ids` or `applicable_product_tags`.",
     "type": "array",
     "items": {
       "type": "object",
       "properties": {
         "exclude": {
           "description": "If provided, the specifier will not apply to
product usage that matches the inclusion criteria and any of the
excluding values.",
           "type": "array",
           "items": {
             "type": "object",
             "properties": {
               "product_tags": {
                 "description": "If provided, the specifier will not
apply to products with all the specified tags.",
                 "type": "array",
                 "items": {
                   "type": "string"
                 }
               }
             }
           },
           "x-mint": {
             "groups": [
               "ff:exclude-specifiers-ga"
             ]
           },
           "x-stainless-skip": true
         },
         "presentation_group_values": {
           "description": "If provided, the specifier will apply to
product usage with these set of presentation group values.",
           "type": "object",
           "additionalProperties": {
             "type": "string"
           }
         },
         "pricing_group_values": {
           "description": "If provided, the specifier will apply to
product usage with these set of pricing group values.",
           "type": "object",
           "additionalProperties": {
             "type": "string"
           }
         },
         "product_id": {
           "description": "If provided, the specifier will only apply to
the product with the specified ID.",
           "type": "string",
           "format": "uuid"
         },
         "product_tags": {
           "description": "If provided, the specifier will only apply to
products with all the specified tags.",
           "type": "array",
           "items": {
             "type": "string"
           }
         }
       }
     }
   },
   "type": {
     "type": "string"
   },
   "uniqueness_key": {
     "description": "Prevents the creation of duplicates. If a request
to create a commit or credit is made with a uniqueness key that was
previously used to create a commit or credit, a new record will not be
created and the request will fail with a 409 error.",
     "type": "string",
     "maxLength": 128,
     "minLength": 1
   }
 }
}

Fields§

§access_schedule: CreateCustomerCommitV1BodyAccessSchedule§applicable_contract_ids: Vec<String>

Which contract the commit applies to. If not provided, the commit applies to all contracts.

§applicable_product_ids: Vec<Uuid>

Which products the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products.

§applicable_product_tags: Vec<String>

Which tags the commit applies to. If applicable_product_ids, applicable_product_tags or specifiers are not provided, the commit applies to all products.

§custom_fields: HashMap<String, String>

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

§customer_id: Uuid§description: Option<String>

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

§invoice_contract_id: Option<Uuid>

The contract that this commit will be billed on. This is required for “POSTPAID” commits and for “PREPAID” commits unless there is no invoice schedule above (i.e., the commit is ‘free’), or if do_not_invoice is set to true.

§invoice_schedule: Option<CreateCustomerCommitV1BodyInvoiceSchedule>§name: Option<CreateCustomerCommitV1BodyName>

displayed on invoices

§netsuite_sales_order_id: Option<String>

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

§priority: f64

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

§product_id: Uuid

ID of the fixed product associated with the commit. This is required because products are used to invoice the commit amount.

§rate_type: Option<String>§salesforce_opportunity_id: Option<String>

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

§specifiers: Vec<CreateCustomerCommitV1BodySpecifiersItem>

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. This field cannot be used together with applicable_product_ids or applicable_product_tags.

§type_: String§uniqueness_key: Option<CreateCustomerCommitV1BodyUniquenessKey>

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

Trait Implementations§

Source§

impl Clone for CreateCustomerCommitV1Body

Source§

fn clone(&self) -> CreateCustomerCommitV1Body

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 CreateCustomerCommitV1Body

Source§

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

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

impl<'de> Deserialize<'de> for CreateCustomerCommitV1Body

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 CreateCustomerCommitV1Body

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