Skip to content

Commit

Permalink
feat(api): api update (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 14, 2025
1 parent db5dc45 commit f8eb0ab
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-3c8dfafd8f2dc6046d9ac043694ee15d4c5156c62153f859fd491e77a306098c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-1c48cee8a4e1a3778bf5a6171c1985d971722cd3534dc6e292651c3d1abe5836.yml
16 changes: 16 additions & 0 deletions src/metronome/resources/contracts/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def create(
reseller_royalties: Iterable[contract_create_params.ResellerRoyalty] | NotGiven = NOT_GIVEN,
salesforce_opportunity_id: str | NotGiven = NOT_GIVEN,
scheduled_charges: Iterable[contract_create_params.ScheduledCharge] | NotGiven = NOT_GIVEN,
scheduled_charges_on_usage_invoices: Literal["ALL"] | NotGiven = NOT_GIVEN,
total_contract_value: float | NotGiven = NOT_GIVEN,
transition: contract_create_params.Transition | NotGiven = NOT_GIVEN,
uniqueness_key: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -169,6 +170,12 @@ def create(
salesforce_opportunity_id: This field's availability is dependent on your client's configuration.
scheduled_charges_on_usage_invoices: Determines which scheduled and commit charges to consolidate onto the Contract's
usage invoice. The charge's `timestamp` must match the usage invoice's
`ending_before` date for consolidation to occur. This field cannot be modified
after a Contract has been created. If this field is omitted, charges will appear
on a separate invoice from usage charges.
total_contract_value: This field's availability is dependent on your client's configuration.
uniqueness_key: Prevents the creation of duplicates. If a request to create a record is made
Expand Down Expand Up @@ -206,6 +213,7 @@ def create(
"reseller_royalties": reseller_royalties,
"salesforce_opportunity_id": salesforce_opportunity_id,
"scheduled_charges": scheduled_charges,
"scheduled_charges_on_usage_invoices": scheduled_charges_on_usage_invoices,
"total_contract_value": total_contract_value,
"transition": transition,
"uniqueness_key": uniqueness_key,
Expand Down Expand Up @@ -919,6 +927,7 @@ async def create(
reseller_royalties: Iterable[contract_create_params.ResellerRoyalty] | NotGiven = NOT_GIVEN,
salesforce_opportunity_id: str | NotGiven = NOT_GIVEN,
scheduled_charges: Iterable[contract_create_params.ScheduledCharge] | NotGiven = NOT_GIVEN,
scheduled_charges_on_usage_invoices: Literal["ALL"] | NotGiven = NOT_GIVEN,
total_contract_value: float | NotGiven = NOT_GIVEN,
transition: contract_create_params.Transition | NotGiven = NOT_GIVEN,
uniqueness_key: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -959,6 +968,12 @@ async def create(
salesforce_opportunity_id: This field's availability is dependent on your client's configuration.
scheduled_charges_on_usage_invoices: Determines which scheduled and commit charges to consolidate onto the Contract's
usage invoice. The charge's `timestamp` must match the usage invoice's
`ending_before` date for consolidation to occur. This field cannot be modified
after a Contract has been created. If this field is omitted, charges will appear
on a separate invoice from usage charges.
total_contract_value: This field's availability is dependent on your client's configuration.
uniqueness_key: Prevents the creation of duplicates. If a request to create a record is made
Expand Down Expand Up @@ -996,6 +1011,7 @@ async def create(
"reseller_royalties": reseller_royalties,
"salesforce_opportunity_id": salesforce_opportunity_id,
"scheduled_charges": scheduled_charges,
"scheduled_charges_on_usage_invoices": scheduled_charges_on_usage_invoices,
"total_contract_value": total_contract_value,
"transition": transition,
"uniqueness_key": uniqueness_key,
Expand Down
9 changes: 9 additions & 0 deletions src/metronome/types/contract_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ class ContractCreateParams(TypedDict, total=False):

scheduled_charges: Iterable[ScheduledCharge]

scheduled_charges_on_usage_invoices: Literal["ALL"]
"""
Determines which scheduled and commit charges to consolidate onto the Contract's
usage invoice. The charge's `timestamp` must match the usage invoice's
`ending_before` date for consolidation to occur. This field cannot be modified
after a Contract has been created. If this field is omitted, charges will appear
on a separate invoice from usage charges.
"""

total_contract_value: float
"""This field's availability is dependent on your client's configuration."""

Expand Down
9 changes: 9 additions & 0 deletions src/metronome/types/contract_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ class Data(BaseModel):
customer_billing_provider_configuration: Optional[DataCustomerBillingProviderConfiguration] = None
"""The billing provider configuration associated with a contract."""

scheduled_charges_on_usage_invoices: Optional[Literal["ALL"]] = None
"""
Determines which scheduled and commit charges to consolidate onto the Contract's
usage invoice. The charge's `timestamp` must match the usage invoice's
`ending_before` date for consolidation to occur. This field cannot be modified
after a Contract has been created. If this field is omitted, charges will appear
on a separate invoice from usage charges.
"""

uniqueness_key: Optional[str] = None
"""Prevents the creation of duplicates.
Expand Down
9 changes: 9 additions & 0 deletions src/metronome/types/contract_retrieve_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ class Data(BaseModel):
customer_billing_provider_configuration: Optional[DataCustomerBillingProviderConfiguration] = None
"""The billing provider configuration associated with a contract."""

scheduled_charges_on_usage_invoices: Optional[Literal["ALL"]] = None
"""
Determines which scheduled and commit charges to consolidate onto the Contract's
usage invoice. The charge's `timestamp` must match the usage invoice's
`ending_before` date for consolidation to occur. This field cannot be modified
after a Contract has been created. If this field is omitted, charges will appear
on a separate invoice from usage charges.
"""

uniqueness_key: Optional[str] = None
"""Prevents the creation of duplicates.
Expand Down
9 changes: 9 additions & 0 deletions src/metronome/types/shared/contract_without_amendments.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ class ContractWithoutAmendments(BaseModel):
salesforce_opportunity_id: Optional[str] = None
"""This field's availability is dependent on your client's configuration."""

scheduled_charges_on_usage_invoices: Optional[Literal["ALL"]] = None
"""
Determines which scheduled and commit charges to consolidate onto the Contract's
usage invoice. The charge's `timestamp` must match the usage invoice's
`ending_before` date for consolidation to occur. This field cannot be modified
after a Contract has been created. If this field is omitted, charges will appear
on a separate invoice from usage charges.
"""

total_contract_value: Optional[float] = None
"""This field's availability is dependent on your client's configuration."""

Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/test_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def test_method_create_with_all_params(self, client: Metronome) -> None:
"netsuite_sales_order_id": "netsuite_sales_order_id",
}
],
scheduled_charges_on_usage_invoices="ALL",
total_contract_value=0,
transition={
"from_contract_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
Expand Down Expand Up @@ -1296,6 +1297,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMetronome)
"netsuite_sales_order_id": "netsuite_sales_order_id",
}
],
scheduled_charges_on_usage_invoices="ALL",
total_contract_value=0,
transition={
"from_contract_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
Expand Down

0 comments on commit f8eb0ab

Please sign in to comment.