Skip to content

Commit 3aede44

Browse files
Cleanup/fix docs, type hints, class ref (#419)
1 parent 54e4dfa commit 3aede44

2 files changed

Lines changed: 8 additions & 51 deletions

File tree

linode_api4/groups/object_storage.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from typing import List, Optional, Union
12
from urllib import parse
23

34
from linode_api4.errors import UnexpectedResponseError
@@ -53,7 +54,11 @@ def keys(self, *filters):
5354
"""
5455
return self.client._get_and_filter(ObjectStorageKeys, *filters)
5556

56-
def keys_create(self, label, bucket_access=None):
57+
def keys_create(
58+
self,
59+
label: str,
60+
bucket_access: Optional[Union[dict, List[dict]]] = None,
61+
):
5762
"""
5863
Creates a new Object Storage keypair that may be used to interact directly
5964
with Linode Object Storage in third-party applications. This response is

linode_api4/objects/object_storage.py

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ def access_modify(
7878
7979
API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-access-modify
8080
81-
:param cluster_id: The ID of the cluster this bucket exists in.
82-
:type cluster_id: str
83-
84-
:param bucket: The bucket name.
85-
:type bucket: str
86-
8781
:param acl: The Access Control Level of the bucket using a canned ACL string.
8882
For more fine-grained control of ACLs, use the S3 API directly.
8983
:type acl: str
@@ -126,12 +120,6 @@ def access_update(
126120
127121
API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-access-update
128122
129-
:param cluster_id: The ID of the cluster this bucket exists in.
130-
:type cluster_id: str
131-
132-
:param bucket: The bucket name.
133-
:type bucket: str
134-
135123
:param acl: The Access Control Level of the bucket using a canned ACL string.
136124
For more fine-grained control of ACLs, use the S3 API directly.
137125
:type acl: str
@@ -168,12 +156,6 @@ def ssl_cert_delete(self):
168156
169157
API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-delete
170158
171-
:param cluster_id: The ID of the cluster this bucket exists in.
172-
:type cluster_id: str
173-
174-
:param bucket: The bucket name.
175-
:type bucket: str
176-
177159
:returns: True if the TLS/SSL certificate and private key in the bucket were successfully deleted.
178160
:rtype: bool
179161
"""
@@ -199,12 +181,6 @@ def ssl_cert(self):
199181
200182
API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-view
201183
202-
:param cluster_id: The ID of the cluster this bucket exists in.
203-
:type cluster_id: str
204-
205-
:param bucket: The bucket name.
206-
:type bucket: str
207-
208184
:returns: A result object which has a bool field indicating if this Bucket has a corresponding
209185
TLS/SSL certificate that was uploaded by an Account user.
210186
:rtype: MappedObject
@@ -234,12 +210,6 @@ def ssl_cert_upload(self, certificate, private_key):
234210
235211
API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-tlsssl-cert-upload
236212
237-
:param cluster_id: The ID of the cluster this bucket exists in.
238-
:type cluster_id: str
239-
240-
:param bucket: The bucket name.
241-
:type bucket: str
242-
243213
:param certificate: Your Base64 encoded and PEM formatted SSL certificate.
244214
Line breaks must be represented as “\n” in the string
245215
for requests (but not when using the Linode CLI)
@@ -291,12 +261,6 @@ def contents(
291261
292262
API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-bucket-contents-list
293263
294-
:param cluster_id: The ID of the cluster this bucket exists in.
295-
:type cluster_id: str
296-
297-
:param bucket: The bucket name.
298-
:type bucket: str
299-
300264
:param marker: The “marker” for this request, which can be used to paginate
301265
through large buckets. Its value should be the value of the
302266
next_marker property returned with the last page. Listing
@@ -357,12 +321,6 @@ def object_acl_config(self, name=None):
357321
358322
API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-object-acl-config-view
359323
360-
:param cluster_id: The ID of the cluster this bucket exists in.
361-
:type cluster_id: str
362-
363-
:param bucket: The bucket name.
364-
:type bucket: str
365-
366324
:param name: The name of the object for which to retrieve its Access Control
367325
List (ACL). Use the Object Storage Bucket Contents List endpoint
368326
to access all object names in a bucket.
@@ -376,7 +334,7 @@ def object_acl_config(self, name=None):
376334
}
377335

378336
result = self._client.get(
379-
f"{ObjectStorageBucket.api_endpoint}/object-acl",
337+
f"{type(self).api_endpoint}/object-acl",
380338
model=self,
381339
data=drop_null_keys(params),
382340
)
@@ -400,12 +358,6 @@ def object_acl_config_update(self, acl: ObjectStorageACL, name):
400358
401359
API Documentation: https://www.linode.com/docs/api/object-storage/#object-storage-object-acl-config-update
402360
403-
:param cluster_id: The ID of the cluster this bucket exists in.
404-
:type cluster_id: str
405-
406-
:param bucket: The bucket name.
407-
:type bucket: str
408-
409361
:param acl: The Access Control Level of the bucket, as a canned ACL string.
410362
For more fine-grained control of ACLs, use the S3 API directly.
411363
:type acl: str
@@ -425,7 +377,7 @@ def object_acl_config_update(self, acl: ObjectStorageACL, name):
425377
}
426378

427379
result = self._client.put(
428-
f"{ObjectStorageBucket.api_endpoint}/object-acl",
380+
f"{type(self).api_endpoint}/object-acl",
429381
model=self,
430382
data=params,
431383
)

0 commit comments

Comments
 (0)