Skip to content

Commit 19407fc

Browse files
committed
Replace all apiclient references by googleapiclient
This is the preferred name, according to googleapis/google-api-python-client@7547de6
1 parent 56f170b commit 19407fc

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

apps_script/execute/execute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
# [START apps_script_api_execute]
1616
from __future__ import print_function
17-
from apiclient import errors
18-
from apiclient.discovery import build
17+
from googleapiclient import errors
18+
from googleapiclient.discovery import build
1919
from httplib2 import Http
2020
from oauth2client import file as oauth_file, client, tools
2121

apps_script/quickstart/quickstart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
project, and log the script's URL to the user.
2020
"""
2121
from __future__ import print_function
22-
from apiclient import errors
22+
from googleapiclient import errors
2323
from googleapiclient.discovery import build
2424
from httplib2 import Http
2525
from oauth2client import file, client, tools

drive/driveapp/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from __future__ import print_function
99
import pprint
1010
import httplib2
11-
import apiclient.discovery
12-
import apiclient.http
11+
from googleapiclient.discovery import build
12+
import googleapiclient.http
1313
import oauth2client.client
1414

1515
# OAuth 2.0 scope that will be authorized.
@@ -38,11 +38,11 @@
3838
# Create an authorized Drive API client.
3939
http = httplib2.Http()
4040
credentials.authorize(http)
41-
drive_service = apiclient.discovery.build('drive', 'v2', http=http)
41+
drive_service = build('drive', 'v2', http=http)
4242

4343
# Insert a file. Files are comprised of contents and metadata.
4444
# MediaFileUpload abstracts uploading file contents from a file on disk.
45-
media_body = apiclient.http.MediaFileUpload(
45+
media_body = googleapiclient.http.MediaFileUpload(
4646
FILENAME,
4747
mimetype=MIMETYPE,
4848
resumable=True

events/next18/qbr_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import argparse
2626
import re
2727

28-
from apiclient.discovery import build
2928
import customer_data_service
3029
import customer_spreadsheet_reader
30+
from googleapiclient.discovery import build
3131
from httplib2 import Http
3232
from oauth2client import file as oauth_file, client, tools
3333
import presentation_reader

sheets/snippets/base_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
from __future__ import print_function
1616
import unittest
1717
import sys
18-
from apiclient import discovery
1918
from oauth2client.client import GoogleCredentials
2019
from googleapiclient import errors
20+
from googleapiclient.discovery import build
2121
import httplib2
2222

2323
class BaseTest(unittest.TestCase):
@@ -26,8 +26,8 @@ def setUpClass(cls):
2626
cls.credentials = cls.create_credentials()
2727
http = cls.credentials.authorize(httplib2.Http())
2828
cls.credentials.refresh(http)
29-
cls.service = discovery.build('sheets', 'v4', http=http)
30-
cls.drive_service = discovery.build('drive', 'v3', http=http)
29+
cls.service = build('sheets', 'v4', http=http)
30+
cls.drive_service = build('drive', 'v3', http=http)
3131
# Hide STDOUT output generated by snippets.
3232
cls.stdout = sys.stdout
3333
sys.stdout = None

slides/snippets/base_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,20 @@
1616
import sys
1717
import unittest
1818
import httplib2
19-
from apiclient import discovery
2019
from oauth2client.client import GoogleCredentials
2120
from googleapiclient import errors
21+
from googleapiclient.discovery import build
22+
2223

2324
class BaseTest(unittest.TestCase):
2425
@classmethod
2526
def setUpClass(cls):
2627
cls.credentials = cls.create_credentials()
2728
http = cls.credentials.authorize(httplib2.Http())
2829
cls.credentials.refresh(http)
29-
cls.service = discovery.build('slides', 'v1', http=http)
30-
cls.drive_service = discovery.build('drive', 'v3', http=http)
31-
cls.sheets_service = discovery.build('sheets', 'v4', http=http)
30+
cls.service = build('slides', 'v1', http=http)
31+
cls.drive_service = build('drive', 'v3', http=http)
32+
cls.sheets_service = build('sheets', 'v4', http=http)
3233
# Hide STDOUT output generated by snippets.
3334
cls.stdout = sys.stdout
3435
sys.stdout = None

0 commit comments

Comments
 (0)