Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "d55532c", "specHash": "c5a35a6", "version": "10.17.1" }
{ "engineHash": "d55532c", "specHash": "e21eebc", "version": "10.17.1" }
58 changes: 46 additions & 12 deletions box_sdk_gen/managers/chunked_uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,18 @@ def upload_file_part_by_url(
:type request_body: ByteStream
:param digest: The [RFC3230][1] message digest of the chunk uploaded.

Only SHA1 is supported. The SHA1 digest must be base64
`SHA-1` and `SHA-512` ([RFC5843][2]) are supported. The digest must be base64
encoded. The format of this header is as
`sha=BASE64_ENCODED_DIGEST`.
`sha=BASE64_ENCODED_DIGEST` for `SHA-1`, or
`sha-512=BASE64_ENCODED_DIGEST` for `SHA-512`.

To get the value for the `SHA` digest, use the
To get the value for the digest, use the
openSSL command to encode the file part:
`openssl sha1 -binary <FILE_PART_NAME> | base64`.
`openssl sha1 -binary <FILE_PART_NAME> | base64` for `SHA-1`, or
`openssl sha512 -binary <FILE_PART_NAME> | base64` for `SHA-512`.

[1]: https://tools.ietf.org/html/rfc3230
[2]: https://tools.ietf.org/html/rfc5843
:type digest: str
:param content_range: The byte range of the chunk.

Expand Down Expand Up @@ -378,15 +381,18 @@ def upload_file_part(
:type request_body: ByteStream
:param digest: The [RFC3230][1] message digest of the chunk uploaded.

Only SHA1 is supported. The SHA1 digest must be base64
`SHA-1` and `SHA-512` ([RFC5843][2]) are supported. The digest must be base64
encoded. The format of this header is as
`sha=BASE64_ENCODED_DIGEST`.
`sha=BASE64_ENCODED_DIGEST` for `SHA-1`, or
`sha-512=BASE64_ENCODED_DIGEST` for `SHA-512`.

To get the value for the `SHA` digest, use the
To get the value for the digest, use the
openSSL command to encode the file part:
`openssl sha1 -binary <FILE_PART_NAME> | base64`.
`openssl sha1 -binary <FILE_PART_NAME> | base64` for `SHA-1`, or
`openssl sha512 -binary <FILE_PART_NAME> | base64` for `SHA-512`.

[1]: https://tools.ietf.org/html/rfc3230
[2]: https://tools.ietf.org/html/rfc5843
:type digest: str
:param content_range: The byte range of the chunk.

Expand Down Expand Up @@ -650,10 +656,10 @@ def create_file_upload_session_plan_by_url(
have already been uploaded (cache hits) and only uploading missing parts.


The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions)


and [`Get upload session`](e://get-files-upload-sessions-id) endpoints.
and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.

:param url: URL of createFileUploadSessionPlan method
:type url: str
Expand Down Expand Up @@ -696,10 +702,10 @@ def create_file_upload_session_plan(
have already been uploaded (cache hits) and only uploading missing parts.


The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions)


and [`Get upload session`](e://get-files-upload-sessions-id) endpoints.
and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.

:param upload_session_id: The ID of the upload session.
Example: "D5E3F7A"
Expand Down Expand Up @@ -761,13 +767,27 @@ def create_file_upload_session_commit_by_url(
:param url: URL of createFileUploadSessionCommit method
:type url: str
:param parts: The list details for the uploaded parts.

Each entry can include `sha1` or `sha512`. Include `sha512`
on every entry or on none of them. A request where only
some entries include `sha512` is rejected.

Include parts that the server already has, returned as
`hits` by the [`Plan upload session`](https://developer.box.com/reference/post-files-upload-sessions-id-plan)
endpoint. Use the `part_id`, `offset`, and `size` from the
plan response. If the other entries include `sha512`,
include the `sha512` value from the plan response.
Otherwise, leave the hash out of these entries.
:type parts: List[UploadPart]
:param digest: The [RFC3230][1] message digest of the whole file.

Only SHA1 is supported. The SHA1 digest must be Base64
encoded. The format of this header is as
`sha=BASE64_ENCODED_DIGEST`.

`SHA-512` is not supported for the whole-file digest, even if
the parts were uploaded with `SHA-512` digests.

[1]: https://tools.ietf.org/html/rfc3230
:type digest: str
:param if_match: Ensures this item hasn't recently changed before
Expand Down Expand Up @@ -837,13 +857,27 @@ def create_file_upload_session_commit(
Example: "D5E3F7A"
:type upload_session_id: str
:param parts: The list details for the uploaded parts.

Each entry can include `sha1` or `sha512`. Include `sha512`
on every entry or on none of them. A request where only
some entries include `sha512` is rejected.

Include parts that the server already has, returned as
`hits` by the [`Plan upload session`](https://developer.box.com/reference/post-files-upload-sessions-id-plan)
endpoint. Use the `part_id`, `offset`, and `size` from the
plan response. If the other entries include `sha512`,
include the `sha512` value from the plan response.
Otherwise, leave the hash out of these entries.
:type parts: List[UploadPart]
:param digest: The [RFC3230][1] message digest of the whole file.

Only SHA1 is supported. The SHA1 digest must be Base64
encoded. The format of this header is as
`sha=BASE64_ENCODED_DIGEST`.

`SHA-512` is not supported for the whole-file digest, even if
the parts were uploaded with `SHA-512` digests.

[1]: https://tools.ietf.org/html/rfc3230
:type digest: str
:param if_match: Ensures this item hasn't recently changed before
Expand Down
45 changes: 42 additions & 3 deletions box_sdk_gen/managers/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,51 @@ def create_query_v2026_r0(
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> QueryResultsV2026R0:
"""
Runs a query to discover Box items using a logical predicate that can filter
Runs a query to discover Box items using a logical predicate, similar to a SQL

across item fields and metadata templates. Results can be sorted, paginated,
WHERE clause. The predicate can filter across multiple metadata templates and


and shaped to include additional item or metadata fields.
item fields in a single request. Results can be sorted, paginated with markers,


and shaped with fields so each entry includes additional item or metadata


attributes.


This is the item-retrieval endpoint in the Query API (version 2026.0). Unlike


the [Metadata Query API](https://developer.box.com/reference/post-metadata-queries-execute-read),


it is not limited to a single metadata template or to files and folders. For


totals and grouped metrics over the same predicates, use


[Query Insights](https://developer.box.com/reference/v2026.0/post-query-insights)


instead of paging through every matching item.


For predicate syntax, parameters, examples, pagination behavior, and error


codes, see the


[Box Query guide](https://developer.box.com/guides/query/box-query). For shared


response schemas, including Query results and result entries, see


[Query resources](https://developer.box.com/reference/v2026.0/query-resources).

:param query: The query definition, including the filtering predicate and its optional
parameters and ancestor restrictions.
Expand Down
9 changes: 9 additions & 0 deletions box_sdk_gen/managers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,17 @@ def search_by_metadata_query(
extra_headers: Optional[Dict[str, Optional[str]]] = None
) -> MetadataQueryResults:
"""
For new integrations, use the [v2026.0 Query API](https://developer.box.com/reference/v2026.0/query-resources).

This is the latest version of the Query API, with advanced capabilities including multi-template queries and


Query Insights, and is the API we will continue to enhance with new Query capabilities.


Create a search using SQL-like syntax to return items that match specific


metadata.


Expand Down
1 change: 1 addition & 0 deletions box_sdk_gen/schemas/client_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ClientErrorCodeField(str, Enum):
METHOD_NOT_ALLOWED = 'method_not_allowed'
CONFLICT = 'conflict'
PRECONDITION_FAILED = 'precondition_failed'
UNPROCESSABLE_ENTITY = 'unprocessable_entity'
TOO_MANY_REQUESTS = 'too_many_requests'
INTERNAL_SERVER_ERROR = 'internal_server_error'
UNAVAILABLE = 'unavailable'
Expand Down
7 changes: 7 additions & 0 deletions box_sdk_gen/schemas/upload_part.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@
class UploadPart(UploadPartMini):
_fields_to_json_mapping: Dict[str, str] = {
'sha_1': 'sha1',
'sha_512': 'sha512',
**UploadPartMini._fields_to_json_mapping,
}
_json_to_fields_mapping: Dict[str, str] = {
'sha1': 'sha_1',
'sha512': 'sha_512',
**UploadPartMini._json_to_fields_mapping,
}

def __init__(
self,
*,
sha_1: Optional[str] = None,
sha_512: Optional[str] = None,
part_id: Optional[str] = None,
offset: Optional[int] = None,
size: Optional[int] = None,
Expand All @@ -29,6 +32,9 @@ def __init__(
"""
:param sha_1: The SHA1 hash of the chunk., defaults to None
:type sha_1: Optional[str], optional
:param sha_512: The `SHA-512` hash of the chunk, as a hex string
of 128 lower case characters., defaults to None
:type sha_512: Optional[str], optional
:param part_id: The unique ID of the chunk., defaults to None
:type part_id: Optional[str], optional
:param offset: The offset of the chunk within the file
Expand All @@ -40,3 +46,4 @@ def __init__(
"""
super().__init__(part_id=part_id, offset=offset, size=size, **kwargs)
self.sha_1 = sha_1
self.sha_512 = sha_512
3 changes: 2 additions & 1 deletion box_sdk_gen/schemas/upload_part_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def __init__(self, offset: int, size: int, sha_512: str, **kwargs):
:type offset: int
:param size: The size of the chunk in bytes.
:type size: int
:param sha_512: The `SHA-512` hash of the chunk.
:param sha_512: The `SHA-512` hash of the chunk, as a hex string
of 128 lower case characters.
:type sha_512: str
"""
super().__init__(**kwargs)
Expand Down
3 changes: 2 additions & 1 deletion box_sdk_gen/schemas/upload_part_plan_hit.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def __init__(self, offset: int, size: int, sha_512: str, part_id: str, **kwargs)
:type offset: int
:param size: The size of the chunk in bytes.
:type size: int
:param sha_512: The `SHA-512` hash of the chunk.
:param sha_512: The `SHA-512` hash of the chunk, as a hex string
of 128 lower case characters.
:type sha_512: str
:param part_id: The unique ID of the chunk.
:type part_id: str
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
from typing import Dict

from typing import Optional

from box_sdk_gen.internal.base_object import BaseObject

from box_sdk_gen.box.errors import BoxSDKError


class DocGenDocumentGenerationDataV2025R0(BaseObject):
def __init__(self, generated_file_name: str, user_input: Dict, **kwargs):
def __init__(
self,
generated_file_name: str,
user_input: Dict,
*,
external_id: Optional[str] = None,
**kwargs
):
"""
:param generated_file_name: File name of the output file.
:type generated_file_name: str
:param generated_file_name: File name of the output file.
:type generated_file_name: str
:param external_id: An optional identifier supplied by the caller for this Box Doc Gen job.
The value is returned on job responses for correlation only. It is not
a Box resource ID, is not required to be unique, and cannot be used to
look up the job., defaults to None
:type external_id: Optional[str], optional
"""
super().__init__(**kwargs)
self.generated_file_name = generated_file_name
self.user_input = user_input
self.external_id = external_id
35 changes: 21 additions & 14 deletions box_sdk_gen/schemas/v2025_r0/doc_gen_job_full_v2025_r0.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,33 @@ def __init__(
id: str,
*,
created_at: Optional[str] = None,
external_id: Optional[str] = None,
output_file: Optional[FileReferenceV2025R0] = None,
output_file_version: Optional[FileVersionBaseV2025R0] = None,
failures: Optional[DocGenJobV2025R0FailuresField] = None,
type: DocGenJobBaseV2025R0TypeField = DocGenJobBaseV2025R0TypeField.DOCGEN_JOB,
**kwargs
):
"""
:param source: Source of the request.
:type source: str
:param status: Status of the job.
:type status: DocGenJobV2025R0StatusField
:param output_type: Type of the generated file.
:type output_type: str
:param id: The unique identifier that represent a Box Doc Gen job.
:type id: str
:param created_at: Time of job creation., defaults to None
:type created_at: Optional[str], optional
:param failures: Errors and warnings that occurred during document generation., defaults to None
:type failures: Optional[DocGenJobV2025R0FailuresField], optional
:param type: The value will always be `docgen_job`., defaults to DocGenJobBaseV2025R0TypeField.DOCGEN_JOB
:type type: DocGenJobBaseV2025R0TypeField, optional
:param source: Source of the request.
:type source: str
:param status: Status of the job.
:type status: DocGenJobV2025R0StatusField
:param output_type: Type of the generated file.
:type output_type: str
:param id: The unique identifier that represent a Box Doc Gen job.
:type id: str
:param created_at: Time of job creation., defaults to None
:type created_at: Optional[str], optional
:param external_id: An optional identifier supplied by the caller when the Box Doc Gen
job was created. Returned for correlation only. It is not a Box
resource ID, is not required to be unique, and cannot be used to
look up the job., defaults to None
:type external_id: Optional[str], optional
:param failures: Errors and warnings that occurred during document generation., defaults to None
:type failures: Optional[DocGenJobV2025R0FailuresField], optional
:param type: The value will always be `docgen_job`., defaults to DocGenJobBaseV2025R0TypeField.DOCGEN_JOB
:type type: DocGenJobBaseV2025R0TypeField, optional
"""
super().__init__(
batch=batch,
Expand All @@ -80,6 +86,7 @@ def __init__(
status=status,
output_type=output_type,
id=id,
external_id=external_id,
output_file=output_file,
output_file_version=output_file_version,
failures=failures,
Expand Down
Loading
Loading