SalesmenClient
- class moloni.api.SalesmenClient(environment: MoloniBaseUrl = MoloniBaseUrl.PROD, *, auth_config: AuthConfig = AuthConfig(client_id=None, client_secret=None, refresh_token=None, username=None, password=None), version: str = 'v1', validate: bool = True, log_level: str = 'INFO')
- count_modified_since(self, data: SalesmenCountModifiedSinceModel | dict, **kwargs)
- Parameters:
data (Union[SalesmenCountModifiedSinceModel, dict]) –
A model instance or dictionary containing the following fields:
company_id (Union[str, int]): company_id of the SalesmenCountModifiedSinceModel.
lastmodified (str): lastmodified of the SalesmenCountModifiedSinceModel.
- Returns:
The response from the API.
- Return type:
- delete(self, data: SalesmenDeleteModel | dict, **kwargs)
- Parameters:
data (Union[SalesmenDeleteModel, dict]) –
A model instance or dictionary containing the following fields:
company_id (Union[str, int]): company_id of the SalesmenDeleteModel.
salesman_id (Union[str, int]): salesman_id of the SalesmenDeleteModel.
- Returns:
The response from the API.
- Return type:
- get_all(self, data: SalesmenGetAllModel | dict, **kwargs)
- Parameters:
data (Union[SalesmenGetAllModel, dict]) –
A model instance or dictionary containing the following fields:
company_id (Union[str, int]): company_id of the SalesmenGetAllModel.
- Returns:
The response from the API.
- Return type:
- get_modified_since(self, data: SalesmenGetModifiedSinceModel | dict, **kwargs)
- Parameters:
data (Union[SalesmenGetModifiedSinceModel, dict]) –
A model instance or dictionary containing the following fields:
company_id (Union[str, int]): company_id of the SalesmenGetModifiedSinceModel.
lastmodified (str): lastmodified of the SalesmenGetModifiedSinceModel.
- Returns:
The response from the API.
- Return type:
- get_one(self, data: SalesmenGetOneModel | dict, **kwargs)
- Parameters:
data (Union[SalesmenGetOneModel, dict]) –
A model instance or dictionary containing the following fields:
company_id (Union[str, int]): company_id of the SalesmenGetOneModel.
salesman_id (Union[str, int]): salesman_id of the SalesmenGetOneModel.
- Returns:
The response from the API.
- Return type:
- insert(self, data: SalesmenInsertModel | dict, **kwargs)
- Parameters:
data (Union[SalesmenInsertModel, dict]) –
A model instance or dictionary containing the following fields:
address (str): address of the SalesmenInsertModel.
base_commission (str): base_commission of the SalesmenInsertModel.
city (str): city of the SalesmenInsertModel.
company_id (Union[str, int]): company_id of the SalesmenInsertModel.
country_id (Union[str, int]): country_id of the SalesmenInsertModel.
email (str): email of the SalesmenInsertModel.
fax (str): fax of the SalesmenInsertModel.
language_id (Union[str, int]): language_id of the SalesmenInsertModel.
name (str): name of the SalesmenInsertModel.
notes (str): notes of the SalesmenInsertModel.
number (str): number of the SalesmenInsertModel.
phone (str): phone of the SalesmenInsertModel.
qty_copies_document (str): qty_copies_document of the SalesmenInsertModel.
vat (str): vat of the SalesmenInsertModel.
website (str): website of the SalesmenInsertModel.
zip_code (str): zip_code of the SalesmenInsertModel.
- Returns:
The response from the API.
- Return type:
- update(self, data: SalesmenUpdateModel | dict, **kwargs)
- Parameters:
data (Union[SalesmenUpdateModel, dict]) –
A model instance or dictionary containing the following fields:
address (str): address of the SalesmenUpdateModel.
base_commission (str): base_commission of the SalesmenUpdateModel.
city (str): city of the SalesmenUpdateModel.
company_id (Union[str, int]): company_id of the SalesmenUpdateModel.
country_id (Union[str, int]): country_id of the SalesmenUpdateModel.
email (str): email of the SalesmenUpdateModel.
fax (str): fax of the SalesmenUpdateModel.
language_id (Union[str, int]): language_id of the SalesmenUpdateModel.
name (str): name of the SalesmenUpdateModel.
notes (str): notes of the SalesmenUpdateModel.
number (str): number of the SalesmenUpdateModel.
phone (str): phone of the SalesmenUpdateModel.
qty_copies_document (str): qty_copies_document of the SalesmenUpdateModel.
salesman_id (Union[str, int]): salesman_id of the SalesmenUpdateModel.
vat (str): vat of the SalesmenUpdateModel.
website (str): website of the SalesmenUpdateModel.
zip_code (str): zip_code of the SalesmenUpdateModel.
- Returns:
The response from the API.
- Return type:
Models:
- class moloni.api.SalesmenCountModifiedSinceModel(*, company_id: str | int, lastmodified: str | None = None)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- company_id: str | int
- lastmodified: str | None
- request(self) ApiResponse
Make an API request using the initialized client.
This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.
- Returns:
The response from the API.
- Raises:
ValueError – If the client is not initialized via the connect method.
Example
# Assuming you have a model instance request_model and an API client api_client
..code-block:: python
- with request_model.connect(auth_config=auth_config) as api:
response = api.request()
# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'lastmodified': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.
- class moloni.api.SalesmenDeleteModel(*, company_id: str | int, salesman_id: str | int | None = None)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- company_id: str | int
- salesman_id: str | int | None
- request(self) ApiResponse
Make an API request using the initialized client.
This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.
- Returns:
The response from the API.
- Raises:
ValueError – If the client is not initialized via the connect method.
Example
# Assuming you have a model instance request_model and an API client api_client
..code-block:: python
- with request_model.connect(auth_config=auth_config) as api:
response = api.request()
# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.
- class moloni.api.SalesmenGetAllModel(*, company_id: str | int)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- company_id: str | int
- request(self) ApiResponse
Make an API request using the initialized client.
This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.
- Returns:
The response from the API.
- Raises:
ValueError – If the client is not initialized via the connect method.
Example
# Assuming you have a model instance request_model and an API client api_client
..code-block:: python
- with request_model.connect(auth_config=auth_config) as api:
response = api.request()
# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.
- class moloni.api.SalesmenGetModifiedSinceModel(*, company_id: str | int, lastmodified: str | None = None)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- company_id: str | int
- lastmodified: str | None
- request(self) ApiResponse
Make an API request using the initialized client.
This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.
- Returns:
The response from the API.
- Raises:
ValueError – If the client is not initialized via the connect method.
Example
# Assuming you have a model instance request_model and an API client api_client
..code-block:: python
- with request_model.connect(auth_config=auth_config) as api:
response = api.request()
# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'lastmodified': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.
- class moloni.api.SalesmenGetOneModel(*, company_id: str | int, salesman_id: str | int | None = None)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- company_id: str | int
- salesman_id: str | int | None
- request(self) ApiResponse
Make an API request using the initialized client.
This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.
- Returns:
The response from the API.
- Raises:
ValueError – If the client is not initialized via the connect method.
Example
# Assuming you have a model instance request_model and an API client api_client
..code-block:: python
- with request_model.connect(auth_config=auth_config) as api:
response = api.request()
# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'company_id': FieldInfo(annotation=Union[str, int], required=True), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.
- class moloni.api.SalesmenInsertModel(*, company_id: str | int, address: str | None = None, base_commission: str | None = None, city: str | None = None, country_id: str | int | None = None, email: str | None = None, fax: str | None = None, language_id: str | int | None = None, name: str | None = None, notes: str | None = None, number: str | None = None, phone: str | None = None, qty_copies_document: str | None = None, vat: str | None = None, website: str | None = None, zip_code: str | None = None)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- company_id: str | int
- address: str | None
- base_commission: str | None
- city: str | None
- country_id: str | int | None
- email: str | None
- fax: str | None
- language_id: str | int | None
- name: str | None
- notes: str | None
- number: str | None
- phone: str | None
- qty_copies_document: str | None
- vat: str | None
- website: str | None
- zip_code: str | None
- request(self) ApiResponse
Make an API request using the initialized client.
This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.
- Returns:
The response from the API.
- Raises:
ValueError – If the client is not initialized via the connect method.
Example
# Assuming you have a model instance request_model and an API client api_client
..code-block:: python
- with request_model.connect(auth_config=auth_config) as api:
response = api.request()
# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'address': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'base_commission': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'city': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'company_id': FieldInfo(annotation=Union[str, int], required=True), 'country_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'email': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'fax': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'language_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'notes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'qty_copies_document': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'vat': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'website': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'zip_code': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.
- class moloni.api.SalesmenUpdateModel(*, company_id: str | int, address: str | None = None, base_commission: str | None = None, city: str | None = None, country_id: str | int | None = None, email: str | None = None, fax: str | None = None, language_id: str | int | None = None, name: str | None = None, notes: str | None = None, number: str | None = None, phone: str | None = None, qty_copies_document: str | None = None, salesman_id: str | int | None = None, vat: str | None = None, website: str | None = None, zip_code: str | None = None)
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- company_id: str | int
- address: str | None
- base_commission: str | None
- city: str | None
- country_id: str | int | None
- email: str | None
- fax: str | None
- language_id: str | int | None
- name: str | None
- notes: str | None
- number: str | None
- phone: str | None
- qty_copies_document: str | None
- salesman_id: str | int | None
- vat: str | None
- website: str | None
- zip_code: str | None
- request(self) ApiResponse
Make an API request using the initialized client.
This method checks if the _api_client attribute is set (i.e., if the client has been initialized via the connect method). If the client is initialized, it will make an API request using the provided method name and the model’s data, excluding the _api_client attribute itself from the request payload. If the client is not initialized, it will raise a ValueError.
- Returns:
The response from the API.
- Raises:
ValueError – If the client is not initialized via the connect method.
Example
# Assuming you have a model instance request_model and an API client api_client
..code-block:: python
- with request_model.connect(auth_config=auth_config) as api:
response = api.request()
# The above example assumes that the connect method has been used to initialize the client. # The request method then sends the model’s data to the API and returns the API’s response.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'address': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'base_commission': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'city': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'company_id': FieldInfo(annotation=Union[str, int], required=True), 'country_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'email': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'fax': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'language_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'notes': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'number': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'qty_copies_document': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'salesman_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'vat': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'website': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'zip_code': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.