def assertSetter(self, value, expected):
    """Constructs an AdWordsClient and sets value using setters..

    Tests that the provided value is parsed to the expected value in the setter
    methods method.

    Args:
      value: multiple Value to test.
      expected: multiple Expected value.
    """
    client = AdWordsClient(headers={
        'authToken': '...',
        'clientCustomerId': '1234567890',
        'userAgent': 'GoogleTest',
        'developerToken': '[email protected]++USD'
    })
    client.partial_failure = value
    client.validate_only = value
    self.assertEquals(client.partial_failure, expected)
示例#2
0
    def assertSetter(self, value, expected):
        """Constructs an AdWordsClient and sets value using setters..

    Tests that the provided value is parsed to the expected value in the setter
    methods method.

    Args:
      value: multiple Value to test.
      expected: multiple Expected value.
    """
        client = AdWordsClient(
            headers={
                'authToken': '...',
                'clientCustomerId': '1234567890',
                'userAgent': 'GoogleTest',
                'developerToken': '[email protected]++USD'
            })
        client.partial_failure = value
        client.validate_only = value
        self.assertEquals(client.partial_failure, expected)
示例#3
0
__author__ = '[email protected] (Stan Grinberg)'

import os
import sys
sys.path.append(os.path.join('..', '..', '..', '..'))

# Import appropriate classes from the client library.
from adspygoogle.adwords.AdWordsClient import AdWordsClient
from adspygoogle.adwords.AdWordsErrors import AdWordsRequestError

# Initialize client object.
client = AdWordsClient(path=os.path.join('..', '..', '..', '..'))

# Initialize appropriate service with validate only flag enabled.
client.validate_only = True
campaign_service = client.GetCampaignService(
    'https://adwords-sandbox.google.com', 'v201003')

campaign_id = 'INSERT_CAMPAIGN_ID_HERE'

# Construct operations for setting bidding transition on a campaign.
try:
    operations = [{
        'operator': 'SET',
        'biddingTransition': {
            'targetBiddingStrategy': {
                'type': 'ConversionOptimizer',
                'pricingModel': 'CONVERSIONS'
            },
            'explicitAdGroupBids': {
示例#4
0
import os
import sys
sys.path.append(os.path.join('..', '..', '..', '..'))

# Import appropriate classes from the client library.
from adspygoogle.adwords.AdWordsClient import AdWordsClient
from adspygoogle.adwords.AdWordsErrors import AdWordsRequestError
from adspygoogle.common import Utils


# Initialize client object.
client = AdWordsClient(path=os.path.join('..', '..', '..', '..'))

# Initialize appropriate service with validate only flag enabled.
client.validate_only = True
campaign_service = client.GetCampaignService(
    'https://adwords-sandbox.google.com', 'v201003')

# Construct operations for adding campaign object and attempt to add campaign.
operations = [{
    'operator': 'ADD',
    'operand': {
        'name': 'Campaign #%s' % Utils.GetUniqueName(),
        'status': 'PAUSED',
        'biddingStrategy': {
            'type': 'ManualCPC'
        },
        'budget': {
            'period': 'DAILY',
            'amount': {