Empresa¶
Recurso singleton client.company (endpoint company). Ver Numeraciones y empresa.
alegrapy.company.Company
¶
Operations related to the company singleton endpoint (/company).
__init__(client)
¶
Initialize the singleton resource with an explicit AlegraClient.
get(fields=None)
¶
Retrieve company information.
Note
When multiple fields are passed, they are joined with ","; Alegra's
documentation lists the enum values but does not state how multiple values
are combined.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fields
|
str or Iterable[str]
|
Optional field(s) to request. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
Parsed JSON response for the company. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
update(params)
¶
Update company information (PUT /company).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
dict
|
Fields to update. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
Parsed JSON response from the server. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
upload_logo(file_path)
¶
Upload the company logo (POST /company/attachment).
Reads the entire image file into memory (no persistent file handle is kept) and
sends it as multipart/form-data with type="logo". Multipart uploads are
not retried by RetryPolicy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str or PathLike
|
Path to an existing image file ( |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
Parsed JSON response from the server (e.g. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If |
ValueError
|
If |