WarehousesClient

class moloni.api.WarehousesClient(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: WarehousesCountModifiedSinceModel | dict, **kwargs)
Parameters:

data (Union[WarehousesCountModifiedSinceModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the WarehousesCountModifiedSinceModel.

  • lastmodified (str): lastmodified of the WarehousesCountModifiedSinceModel.

Returns:

The response from the API.

Return type:

ApiResponse

delete(self, data: WarehousesDeleteModel | dict, **kwargs)
Parameters:

data (Union[WarehousesDeleteModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the WarehousesDeleteModel.

  • warehouse_id (Union[str, int]): warehouse_id of the WarehousesDeleteModel.

Returns:

The response from the API.

Return type:

ApiResponse

get_all(self, data: WarehousesGetAllModel | dict, **kwargs)
Parameters:

data (Union[WarehousesGetAllModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the WarehousesGetAllModel.

Returns:

The response from the API.

Return type:

ApiResponse

get_modified_since(self, data: WarehousesGetModifiedSinceModel | dict, **kwargs)
Parameters:

data (Union[WarehousesGetModifiedSinceModel, dict]) –

A model instance or dictionary containing the following fields:

  • company_id (Union[str, int]): company_id of the WarehousesGetModifiedSinceModel.

  • lastmodified (str): lastmodified of the WarehousesGetModifiedSinceModel.

Returns:

The response from the API.

Return type:

ApiResponse

insert(self, data: WarehousesInsertModel | dict, **kwargs)
Parameters:

data (Union[WarehousesInsertModel, dict]) –

A model instance or dictionary containing the following fields:

  • address (str): address of the WarehousesInsertModel.

  • city (str): city of the WarehousesInsertModel.

  • code (str): code of the WarehousesInsertModel.

  • company_id (Union[str, int]): company_id of the WarehousesInsertModel.

  • contact_email (str): contact_email of the WarehousesInsertModel.

  • contact_name (str): contact_name of the WarehousesInsertModel.

  • country_id (Union[str, int]): country_id of the WarehousesInsertModel.

  • fax (str): fax of the WarehousesInsertModel.

  • is_default (bool): is_default of the WarehousesInsertModel.

  • phone (str): phone of the WarehousesInsertModel.

  • title (str): title of the WarehousesInsertModel.

  • zip_code (str): zip_code of the WarehousesInsertModel.

Returns:

The response from the API.

Return type:

ApiResponse

update(self, data: WarehousesUpdateModel | dict, **kwargs)
Parameters:

data (Union[WarehousesUpdateModel, dict]) –

A model instance or dictionary containing the following fields:

  • address (str): address of the WarehousesUpdateModel.

  • city (str): city of the WarehousesUpdateModel.

  • code (str): code of the WarehousesUpdateModel.

  • company_id (Union[str, int]): company_id of the WarehousesUpdateModel.

  • contact_email (str): contact_email of the WarehousesUpdateModel.

  • contact_name (str): contact_name of the WarehousesUpdateModel.

  • country_id (Union[str, int]): country_id of the WarehousesUpdateModel.

  • fax (str): fax of the WarehousesUpdateModel.

  • is_default (bool): is_default of the WarehousesUpdateModel.

  • phone (str): phone of the WarehousesUpdateModel.

  • title (str): title of the WarehousesUpdateModel.

  • warehouse_id (Union[str, int]): warehouse_id of the WarehousesUpdateModel.

  • zip_code (str): zip_code of the WarehousesUpdateModel.

Returns:

The response from the API.

Return type:

ApiResponse

Models:

class moloni.api.WarehousesCountModifiedSinceModel(*, 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.WarehousesDeleteModel(*, company_id: str | int, warehouse_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
warehouse_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), 'warehouse_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.WarehousesGetAllModel(*, 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.WarehousesGetModifiedSinceModel(*, 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.WarehousesInsertModel(*, company_id: str | int, address: str | None = None, city: str | None = None, code: str | None = None, contact_email: str | None = None, contact_name: str | None = None, country_id: str | int | None = None, fax: str | None = None, is_default: bool | None = None, phone: str | None = None, title: 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
city: str | None
code: str | None
contact_email: str | None
contact_name: str | None
country_id: str | int | None
fax: str | None
is_default: bool | None
phone: str | None
title: 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), 'city': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'code': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'company_id': FieldInfo(annotation=Union[str, int], required=True), 'contact_email': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'contact_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'country_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'fax': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'is_default': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'title': 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.WarehousesUpdateModel(*, company_id: str | int, address: str | None = None, city: str | None = None, code: str | None = None, contact_email: str | None = None, contact_name: str | None = None, country_id: str | int | None = None, fax: str | None = None, is_default: bool | None = None, phone: str | None = None, title: str | None = None, warehouse_id: str | int | 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
city: str | None
code: str | None
contact_email: str | None
contact_name: str | None
country_id: str | int | None
fax: str | None
is_default: bool | None
phone: str | None
title: str | None
warehouse_id: str | int | 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), 'city': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'code': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'company_id': FieldInfo(annotation=Union[str, int], required=True), 'contact_email': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'contact_name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'country_id': FieldInfo(annotation=Union[str, int, NoneType], required=False, default=None), 'fax': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'is_default': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'phone': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'title': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'warehouse_id': FieldInfo(annotation=Union[str, int, 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.