Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(storage): change the method names in snippets file #161

Merged
merged 1 commit into from May 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/snippets.py
Expand Up @@ -33,7 +33,7 @@ def snippet(func):


@snippet
def storage_get_started(client, to_delete):
def storage_get_started(to_delete):
# [START storage_get_started]
client = storage.Client()
bucket = client.get_bucket("bucket-id-here")
Expand Down Expand Up @@ -85,7 +85,7 @@ def client_bucket_acl(client, to_delete):


@snippet
def download_to_file(client, to_delete):
def download_to_file(to_delete):
# [START download_to_file]
from google.cloud.storage import Blob

Expand All @@ -102,7 +102,7 @@ def download_to_file(client, to_delete):


@snippet
def upload_from_file(client, to_delete):
def upload_from_file(to_delete):
# [START upload_from_file]
from google.cloud.storage import Blob

Expand All @@ -118,7 +118,7 @@ def upload_from_file(client, to_delete):


@snippet
def get_blob(client, to_delete):
def get_blob(to_delete):
from google.cloud.storage.blob import Blob

# [START get_blob]
Expand All @@ -134,7 +134,7 @@ def get_blob(client, to_delete):


@snippet
def delete_blob(client, to_delete):
def delete_blob(to_delete):
# [START delete_blob]
from google.cloud.exceptions import NotFound

Expand All @@ -159,7 +159,7 @@ def delete_blob(client, to_delete):


@snippet
def configure_website(client, to_delete):
def configure_website(to_delete):
bucket_name = "test-bucket"
# [START configure_website]
client = storage.Client()
Expand Down Expand Up @@ -191,7 +191,7 @@ def get_bucket(client, to_delete):
def add_lifecycle_delete_rule(client, to_delete):
# [START add_lifecycle_delete_rule]
bucket = client.get_bucket("my-bucket")
bucket.add_lifecycle_rule_delete(age=2)
bucket.add_lifecycle_delete_rule(age=2)
bucket.patch()
# [END add_lifecycle_delete_rule]
to_delete.append(bucket)
Expand All @@ -201,7 +201,7 @@ def add_lifecycle_delete_rule(client, to_delete):
def add_lifecycle_set_storage_class_rule(client, to_delete):
# [START add_lifecycle_set_storage_class_rule]
bucket = client.get_bucket("my-bucket")
bucket.add_lifecycle_rule_set_storage_class(
bucket.add_lifecycle_set_storage_class_rule(
"COLD_LINE", matches_storage_class=["NEARLINE"]
)
bucket.patch()
Expand Down Expand Up @@ -250,7 +250,7 @@ def list_buckets(client, to_delete):


@snippet
def policy_document(client, to_delete):
def policy_document(client):
# pylint: disable=unused-argument
# [START policy_document]
bucket = client.bucket("my-bucket")
Expand Down