\Google\AdsApi\CommonAdsHeaderHandler

Handles how HTTP and SOAP headers are set for ads API requests.

Summary

Methods
Constants
generateHttpHeaders()
generateSoapHeaders()
SOAP_HEADER_NAME
No protected methods found
N/A
No private methods found
N/A

Constants

SOAP_HEADER_NAME

SOAP_HEADER_NAME

Methods

generateHttpHeaders()

generateHttpHeaders(\Google\AdsApi\Common\AdsSession  $session): array

Generates the required HTTP headers for the ads API request.

Parameters

\Google\AdsApi\Common\AdsSession $session

session information to use for the headers

Returns

array —

the HTTP headers

generateSoapHeaders()

generateSoapHeaders(\Google\AdsApi\Common\AdsSession  $session,\Google\AdsApi\Common\AdsServiceDescriptor  $adsServiceDescriptor): \SoapHeader

Sets the required SOAP headers for the ads API request.

Parameters

\Google\AdsApi\Common\AdsSession $session

session information to use for the headers

\Google\AdsApi\Common\AdsServiceDescriptor $adsServiceDescriptor

descriptor for the ads API service the headers are being generated for

Throws

\InvalidArgumentException

if an invalid combination of headers are set

Returns

\SoapHeader —

the SOAP headers