pub struct FinanceTaxTypesResource<'a> { /* private fields */ }Expand description
client.finance().tax_types()
Implementations§
Source§impl<'a> FinanceTaxTypesResource<'a>
impl<'a> FinanceTaxTypesResource<'a>
Sourcepub fn create(&self, body: &TaxTypeCreate) -> Result<TaxType>
pub fn create(&self, body: &TaxTypeCreate) -> Result<TaxType>
Create a tax type
POST /finance/taxtypes
Tax types group tax rates by their accounting purpose, for example input tax or output tax. The percentage and receiving ledger account are configured on each tax rate. Requires finance “edit masterdata”. Returns HTTP 200 on success. The name must be unique.
§Example
let body = models::TaxTypeCreate {
sort_key: 0,
..Default::default()
};
let result = client.finance().tax_types().create(&body)?;
println!("{:?}", result.name);Sourcepub fn delete(&self, id: impl Display) -> Result<()>
pub fn delete(&self, id: impl Display) -> Result<()>
Delete tax type
DELETE /finance/taxtypes/{id}
Deletes this tax type if no tax rates reference it. Requires finance “edit masterdata”. dry_run=true returns the HTTP 409 conflict report without deleting, also when deletion is allowed.
Use Self::delete_with to pass query parameters.
§Example
client.finance().tax_types().delete(1)?;Sourcepub fn delete_with(
&self,
id: impl Display,
query: &DeleteFinanceTaxtypesIdQuery,
) -> Result<()>
pub fn delete_with( &self, id: impl Display, query: &DeleteFinanceTaxtypesIdQuery, ) -> Result<()>
Delete tax type
Like Self::delete, with query parameters.
DELETE /finance/taxtypes/{id}
Deletes this tax type if no tax rates reference it. Requires finance “edit masterdata”. dry_run=true returns the HTTP 409 conflict report without deleting, also when deletion is allowed.
Sourcepub fn get(&self, id: impl Display) -> Result<TaxType>
pub fn get(&self, id: impl Display) -> Result<TaxType>
Get a tax type
GET /finance/taxtypes/{id}
Tax types group tax rates by their accounting purpose, for example input tax or output tax. The percentage and receiving ledger account are configured on each tax rate. Returns one definition by ID.
§Example
let tax_type = client.finance().tax_types().get(1)?;
println!("{:?}", tax_type.name);Sourcepub fn list(&self) -> Result<Vec<TaxType>>
pub fn list(&self) -> Result<Vec<TaxType>>
Get all tax types
GET /finance/taxtypes
Tax types group tax rates by their accounting purpose, for example input tax or output tax. The percentage and receiving ledger account are configured on each tax rate. Returns an unpaginated list. Results are ordered by sortKey, then name, ascending. meta.count is the number returned.
§Example
for tax_type in client.finance().tax_types().list()? {
println!("{:?}", tax_type.name);
}Sourcepub fn update(&self, id: impl Display, body: &TaxTypeUpdate) -> Result<TaxType>
pub fn update(&self, id: impl Display, body: &TaxTypeUpdate) -> Result<TaxType>
Update tax type
PUT /finance/taxtypes/{id}
Replaces this tax type. Requires finance “edit masterdata”. All required creation fields must be supplied again. Omitted name is cleared; names must remain unique.
§Example
let body = models::TaxTypeUpdate {
sort_key: 0,
..Default::default()
};
let result = client.finance().tax_types().update(1, &body)?;
println!("{:?}", result.name);