Skip to content

Commit

Permalink
Add missing s3 injected methods
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Nov 21, 2024
1 parent 7716b1f commit 66ab3de
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions mypy_boto3_builder/type_maps/service_stub_map/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
CLIENT: s3.CLIENT_METHODS,
"Bucket": s3.BUCKET_METHODS,
"Object": s3.OBJECT_METHODS,
"ObjectSummary": s3.OBJECT_SUMMARY_METHODS,
},
}

Expand Down
16 changes: 16 additions & 0 deletions mypy_boto3_builder/type_maps/service_stub_map/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@
docstring="Upload a file-like object to S3.",
)

bucket_load_method = Method(
name="load",
arguments=[Argument.self()],
return_type=Type.none,
docstring="Calls s3.Client.list_buckets() to update the attributes of the Bucket resource.",
)

object_summary_load_method = Method(
name="load",
arguments=[Argument.self()],
return_type=Type.none,
docstring="Calls s3.Client.head_object to update the attributes of the ObjectSummary resource.",
)


CLIENT_METHODS = (
copy_method,
Expand All @@ -137,6 +151,7 @@
upload_fileobj_method,
)
BUCKET_METHODS = (
bucket_load_method,
copy_method.copy().remove_argument("Bucket"),
download_file_method.copy().remove_argument("Bucket"),
download_fileobj_method.copy().remove_argument("Bucket"),
Expand All @@ -150,3 +165,4 @@
upload_file_method.copy().remove_argument("Bucket", "Key"),
upload_fileobj_method.copy().remove_argument("Bucket", "Key"),
)
OBJECT_SUMMARY_METHODS = (object_summary_load_method,)

0 comments on commit 66ab3de

Please sign in to comment.