Google::Ads::GoogleAds::OAuth2ServiceAccountsHandler
A concrete implementation of Google::Ads::GoogleAds::Common::OAuth2BaseHandler that supports OAuth2 for service accounts and defines the scope required to access the Google Ads API server.
See https://developers.google.com/identity/protocols/oauth2/service-account for details of the protocol.
Each of these attributes can be set via Google::Ads::GoogleAds::OAuth2ServiceAccountsHandler->new().
Alternatively, there is a get_ and set_ method associated with each attribute for retrieving or setting them dynamically.
A reference to the API client used to handle the API requests.
The absolute path to the local JSON key file for the OAuth2 service account.
The email address account to impersonate, when the service account has been delegated domain wide access.
Stores an OAuth2 access token after the authorization flow is followed or for you to manually set it in case you had it previously stored. If this is manually set this handler will verify its validity before preparing a request.
Stores additional OAuth2 scopes as a comma-separated string. These scopes define which services the tokens are allowed to access, e.g. https://www.googleapis.com/auth/analytics.
Initializes the handler with the API client object and the properties such as json_key_file_path and impersonated_email, used for generating authorization requests.
A required api_client with a reference to the API client object handling the requests against the API.
A hash reference with the following keys:
{ jsonKeyFilePath => "json-key-file-path", impersonatedEmail => "impersonated-email", accessToken => "access-token", additionalScopes => "additional-scopes", }
Refer to the documentation of the properties as "json_key_file_path", "impersonated_email", "access_token" and "additional_scopes".
Refer to Google::Ads::GoogleAds::Common::AuthHandlerInterface documentation of this method.
Method defined by Google::Ads::GoogleAds::Common::OAuth2BaseHandler and implemented in this class to return the required OAuth2 scopes as an array.
Method defined by Google::Ads::GoogleAds::Common::OAuth2BaseHandler and implemented in this class to refresh the stored OAuth2 access token.
Private method to return the OAuth2 scopes as a list of strings separated by commas. This is the format expected when sending the OAuth request.
The string of OAuth2 scopes separated by commas.
Copyright 2021 Google LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
$Rev: $ $LastChangedBy: $ $Id: $
To install Google::Ads::GoogleAds::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Google::Ads::GoogleAds::Client
CPAN shell
perl -MCPAN -e shell install Google::Ads::GoogleAds::Client
For more information on module installation, please visit the detailed CPAN module installation guide.