Skip to content

Commit

Permalink
docs: add api part to upload urls (box/box-openapi#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Sep 11, 2024
1 parent b56af05 commit 06d8e40
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "5b7aecf", "specHash": "368fe5a", "version": "1.4.1" }
{ "engineHash": "5b7aecf", "specHash": "915b38a", "version": "1.4.1" }
10 changes: 8 additions & 2 deletions box_sdk_gen/managers/chunked_uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ def create_file_upload_session(
headers_map: Dict[str, str] = prepare_params({**extra_headers})
response: FetchResponse = fetch(
FetchOptions(
url=''.join(['https://upload.box.com/2.0/files/upload_sessions']),
url=''.join(
[
self.network_session.base_urls.upload_url,
'/2.0/files/upload_sessions',
]
),
method='POST',
headers=headers_map,
data=serialize(request_body),
Expand Down Expand Up @@ -168,7 +173,8 @@ def create_file_upload_session_for_existing_file(
FetchOptions(
url=''.join(
[
'https://upload.box.com/2.0/files/',
self.network_session.base_urls.upload_url,
'/2.0/files/',
to_string(file_id),
'/upload_sessions',
]
Expand Down
7 changes: 5 additions & 2 deletions box_sdk_gen/managers/uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def upload_file_version(
FetchOptions(
url=''.join(
[
'https://upload.box.com/2.0/files/',
self.network_session.base_urls.upload_url,
'/2.0/files/',
to_string(file_id),
'/content',
]
Expand Down Expand Up @@ -384,7 +385,9 @@ def upload_file(
)
response: FetchResponse = fetch(
FetchOptions(
url=''.join(['https://upload.box.com/2.0/files/content']),
url=''.join(
[self.network_session.base_urls.upload_url, '/2.0/files/content']
),
method='POST',
params=query_params_map,
headers=headers_map,
Expand Down

0 comments on commit 06d8e40

Please sign in to comment.