|
1 | 1 | # -*- coding: utf-8 -*- |
2 | | -# MinIO Python Library for Amazon S3 Compatible Cloud Storage, |
3 | | -# (C) 2016-2020 MinIO, Inc. |
| 2 | +# MinIO Python Library for Amazon S3 Compatible Cloud Storage, (C) |
| 3 | +# [2014] - [2025] MinIO, Inc. |
4 | 4 | # |
5 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 6 | # you may not use this file except in compliance with the License. |
|
17 | 17 | from datetime import datetime, timezone |
18 | 18 |
|
19 | 19 | from minio import Minio |
20 | | -from minio.commonconfig import REPLACE, CopySource |
| 20 | +from minio.args import Directive, SourceObject |
21 | 21 |
|
22 | 22 | client = Minio( |
23 | 23 | endpoint="play.min.io", |
|
29 | 29 | result = client.copy_object( |
30 | 30 | bucket_name="my-bucket", |
31 | 31 | object_name="my-object", |
32 | | - source=CopySource( |
| 32 | + source=SourceObject( |
33 | 33 | bucket_name="my-sourcebucket", object_name="my-sourceobject", |
34 | 34 | ), |
35 | 35 | ) |
|
39 | 39 | result = client.copy_object( |
40 | 40 | bucket_name="my-bucket", |
41 | 41 | object_name="my-object", |
42 | | - source=CopySource( |
| 42 | + source=SourceObject( |
43 | 43 | bucket_name="my-sourcebucket", |
44 | 44 | object_name="my-sourceobject", |
45 | 45 | modified_since=datetime(2014, 4, 1, tzinfo=timezone.utc), |
|
51 | 51 | result = client.copy_object( |
52 | 52 | bucket_name="my-bucket", |
53 | 53 | object_name="my-object", |
54 | | - source=CopySource( |
| 54 | + source=SourceObject( |
55 | 55 | bucket_name="my-sourcebucket", object_name="my-sourceobject", |
56 | 56 | ), |
57 | 57 | user_metadata={"test_meta_key": "test_meta_value"}, |
58 | | - metadata_directive=REPLACE, |
| 58 | + metadata_directive=Directive.REPLACE, |
59 | 59 | ) |
60 | 60 | print(result.object_name, result.version_id) |
0 commit comments