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

Including functionaity for service accounts #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions tap_google_ads/client.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
from google.ads.googleads.client import GoogleAdsClient


def create_sdk_client(config, login_customer_id=None):
CONFIG = {
"use_proto_plus": False,
"developer_token": config["developer_token"],
"client_id": config["oauth_client_id"],
"client_secret": config["oauth_client_secret"],
"refresh_token": config["refresh_token"],
}
def create_sdk_client(config, login_customer_id=None, service_account_auth_file=False, service_account_auth_string=False):
if service_account_auth_file:
CONFIG = {
"use_proto_plus": config["use_proto_plus"],
"developer_token": config["developer_token"],
"impersonated_email": config["impersonated_email"],
"json_key_string": config["json_key_file"],
}
elif service_account_auth_string:
CONFIG = {
"use_proto_plus": config["use_proto_plus"],
"developer_token": config["developer_token"],
"impersonated_email": config["impersonated_email"],
"json_key_string": config["json_key_string"],
}
else:
CONFIG = {
"use_proto_plus": False,
"developer_token": config["developer_token"],
"client_id": config["oauth_client_id"],
"client_secret": config["oauth_client_secret"],
"refresh_token": config["refresh_token"],
}

if login_customer_id:
CONFIG["login_customer_id"] = login_customer_id
Expand Down