8000 Clean up Auth region tags. (#1417) · jmcarp/python-docs-samples@d343967 · GitHub
[go: up one dir, main page]

Skip to content

Commit d343967

Browse files
authored
Clean up Auth region tags. (GoogleCloudPlatform#1417)
1 parent 5ab334c commit d343967

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

auth/api-client/snippets.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import argparse
1919

2020

21+
# [START auth_api_implicit]
2122
def implicit(project):
2223
import googleapiclient.discovery
2324

@@ -28,8 +29,10 @@ def implicit(project):
2829
# Make an authenticated API request
2930
buckets = storage_client.buckets().list(project=project).execute()
3031
print(buckets)
32+
# [END auth_api_implicit]
3133

3234

35+
# [START auth_api_explicit]
3336
def explicit(project):
3437
from google.oauth2 import service_account
3538
import googleapiclient.discovery
@@ -46,8 +49,10 @@ def explicit(project):
4649
# Make an authenticated API request
4750
buckets = storage_client.buckets().list(project=project).execute()
4851
print(buckets)
52+
# [END auth_api_explicit]
4953

5054

55+
# [START auth_api_explicit_compute_engine]
5156
def explicit_compute_engine(project):
5257
from google.auth import compute_engine
5358
import googleapiclient.discovery
@@ -63,8 +68,10 @@ def explicit_compute_engine(project):
6368
# Make an authenticated API request
6469
buckets = storage_client.buckets().list(project=project).execute()
6570
print(buckets)
71+
# [END auth_api_explicit_compute_engine]
6672

6773

74+
# [START auth_api_explicit_app_engine]
6875
def explicit_app_engine(project):
6976
from google.auth import app_engine
7077
import googleapiclient.discovery
@@ -80,6 +87,7 @@ def explicit_app_engine(project):
8087
# Make an authenticated API request
8188
buckets = storage_client.buckets().list(project=project).execute()
8289
print(buckets)
90+
# [END auth_api_explicit_app_engine]
8391

8492

8593
if __name__ == '__main__':

auth/cloud-client/snippets.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import argparse
1919

2020

21+
# [START auth_cloud_implicit]
2122
def implicit():
2223
from google.cloud import storage
2324

@@ -28,8 +29,10 @@ def implicit():
2829
# Make an authenticated API request
2930
buckets = list(storage_client.list_buckets())
3031
print(buckets)
32+
# [END auth_cloud_implicit]
3133

3234

35+
# [START auth_cloud_explicit]
3336
def explicit():
3437
from google.cloud import storage
3538

@@ -41,8 +44,10 @@ def explicit():
4144
# Make an authenticated API request
4245
buckets = list(storage_client.list_buckets())
4346
print(buckets)
47+
# [END auth_cloud_explicit]
4448

4549

50+
# [START auth_cloud_explicit_compute_engine]
4651
def explicit_compute_engine(project):
4752
from google.auth import compute_engine
4853
from google.cloud import storage
@@ -57,6 +62,7 @@ def explicit_compute_engine(project):
5762
# Make an authenticated API request
5863
buckets = list(storage_client.list_buckets())
5964
print(buckets)
65+
# [END auth_cloud_explicit_compute_engine]
6066

6167

6268
if __name__ == '__main__':

auth/http-client/snippets.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import argparse
1919

2020

21+
# [START auth_http_implicit]
2122
def implicit():
2223
import google.auth
2324
from google.auth.transport import requests
@@ -36,8 +37,10 @@ def implicit():
3637
response.raise_for_status()
3738
buckets = response.json()
3839
print(buckets)
40+
# [END auth_http_implicit]
3941

4042

43+
# [START auth_http_explicit]
4144
def explicit(project):
4245
from google.auth.transport import requests
4346
from google.oauth2 import service_account
@@ -59,6 +62,7 @@ def explicit(project):
5962
response.raise_for_status()
6063
buckets = response.json()
6164
print(buckets)
65+
# [END auth_http_explicit]
6266

6367

6468
if __name__ == '__main__':

0 commit comments

Comments
 (0)
0