Constants

DEFAULT_APPLICATION_NAME

DEFAULT_APPLICATION_NAME

DEFAULT_ENDPOINT

DEFAULT_ENDPOINT

Properties

$DEFAULT_SOAP_LOGGER_CHANNEL

$DEFAULT_SOAP_LOGGER_CHANNEL :

Type

$DEFAULT_REPORT_DOWNLOADER_LOGGER_CHANNEL

$DEFAULT_REPORT_DOWNLOADER_LOGGER_CHANNEL :

Type

$adsLoggerFactory

$adsLoggerFactory :

Type

$configurationLoader

$configurationLoader :

Type

$connectionSettingsBuilder

$connectionSettingsBuilder :

Type

$soapSettingsBuilder

$soapSettingsBuilder :

Type

$networkCode

$networkCode :

Type

$applicationName

$applicationName :

Type

$endpoint

$endpoint :

Type

$oAuth2Credential

$oAuth2Credential :

Type

$connectionSettings

$connectionSettings :

Type

$soapSettings

$soapSettings :

Type

$isIcsUser

$isIcsUser :

Type

$impersonatedUser

$impersonatedUser :

Type

$soapLogger

$soapLogger :

Type

$reportDownloaderLogger

$reportDownloaderLogger :

Type

$adsHeaderFormatter

$adsHeaderFormatter :

Type

Methods

__construct()

__construct()

fromFile()

fromFile(string|null  $path = null): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Reads configuration settings from the specified filepath. The filepath is optional, and if omitted, it will look for the default configuration filename in the home directory of the user running PHP.

Parameters

string|null $path

the filepath

Throws

\InvalidArgumentException

if the configuration file could not be found

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder populated from the configuration

from()

from(\Google\AdsApi\Common\Configuration  $configuration): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Populates this builder from the specified configuration object.

Parameters

\Google\AdsApi\Common\Configuration $configuration

a configuration object that holds the same data as an *.ini file would have

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder populated from the configuration

withNetworkCode()

withNetworkCode(string  $networkCode): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Includes network code. This is required.

Parameters

string $networkCode

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder

withApplicationName()

withApplicationName(string  $applicationName): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Includes application name. This is required.

Parameters

string $applicationName

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder

withEndpoint()

withEndpoint(string|null  $endpoint): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Includes the Ad Manager API server's base endpoint. This is optional.

Parameters

string|null $endpoint

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder

withOAuth2Credential()

withOAuth2Credential(\Google\Auth\FetchAuthTokenInterface  $oAuth2Credential): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Includes the OAuth2 credential to be used for authentication. This is required.

Parameters

\Google\Auth\FetchAuthTokenInterface $oAuth2Credential

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder

asIcsUserForNetwork()

asIcsUserForNetwork(string  $networkCode): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Allows the session to act as an ICS user for the specified network.

Parameters

string $networkCode

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder

asImpersonatedUser()

asImpersonatedUser(string  $impersonatedUser): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Impersonates the specified user.

Parameters

string $impersonatedUser

the email address of the user to impersonate

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder

withSoapLogger()

withSoapLogger(\Psr\Log\LoggerInterface  $soapLogger): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Includes a PSR-3 compliant logger for logging SOAP calls. This is optional.

Parameters

\Psr\Log\LoggerInterface $soapLogger

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder

withReportDownloaderLogger()

withReportDownloaderLogger(\Psr\Log\LoggerInterface  $reportDownloaderLogger): \Google\AdsApi\AdManager\AdManagerSessionBuilder

Includes a PSR-3 compliant logger for the report downloader utility to log report download calls. This is optional.

Parameters

\Psr\Log\LoggerInterface $reportDownloaderLogger

Returns

\Google\AdsApi\AdManager\AdManagerSessionBuilder

this builder

build()

build(): mixed

Creates a new instance of the data object being populated. This method should call defaultOptionals() and validate().

Returns

mixed —

the data object

defaultOptionals()

defaultOptionals()

Sets all optional fields to their default if they are `null`.

validate()

validate()

Checks that required fields have been included and all included fields are valid (e.g., URIs are valid).

getNetworkCode()

getNetworkCode(): string

Gets the network code.

Returns

string

getApplicationName()

getApplicationName(): string

Gets the application name.

Returns

string

getEndpoint()

getEndpoint(): string

Gets the endpoint.

Returns

string

getOAuth2Credential()

getOAuth2Credential(): \Google\Auth\FetchAuthTokenInterface

Gets the OAuth2 credential.

Returns

\Google\Auth\FetchAuthTokenInterface

isIcsUser()

isIcsUser(): boolean|null

If ICS access is being used.

Returns

boolean|null

getImpersonatedUser()

getImpersonatedUser(): string|null

Gets the email address of the impersonated user.

Returns

string|null

getSoapLogger()

getSoapLogger(): \Psr\Log\LoggerInterface

Gets the SOAP logger.

Returns

\Psr\Log\LoggerInterface

getReportDownloaderLogger()

getReportDownloaderLogger(): \Psr\Log\LoggerInterface

Gets the report downloader logger.

Returns

\Psr\Log\LoggerInterface