Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bulk_service=ServiceClient(
service='BulkService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=10,
)
campaign_service=ServiceClient(
service='CampaignManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=10,
)
customer_service=ServiceClient(
'CustomerManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=9,
)
def authenticate_with_username():
'''
Sets the authentication property of the global AuthorizationData instance with PasswordAuthentication.
'''
global authorization_data
authentication=PasswordAuthentication(
user_name='UserNameGoesHere',
password='PasswordGoesHere'
)
""" Initialize a new instance of this class.
:param authorization_data: Represents a user who intends to access the corresponding customer and account.
:type authorization_data: AuthorizationData
:param environment: (optional) Represents which API environment to use, default is `production`, you can also pass `sandbox` in
:type environment: str
:param poll_interval_in_milliseconds: (optional) The time interval in milliseconds between two status polling attempts.
The default value is 15000 milliseconds.
:type poll_interval_in_milliseconds: int
:param working_directory: (optional) Directory for storing temporary files needed for some operations
(for example :func:`upload_entities` creates a temporary upload file).
:param suds_options: The suds options need to pass to suds client
"""
self._environment = environment
self._service_client = ServiceClient('BulkService', 12, authorization_data, environment, **suds_options)
self._authorization_data = authorization_data
self._poll_interval_in_milliseconds = poll_interval_in_milliseconds
self._working_directory = os.path.join(tempfile.gettempdir(), WORKING_NAME)
if working_directory is not None:
self._working_directory = working_directory
# make sure the working directory exists or create it.
if not os.path.exists(self._working_directory):
os.makedirs(self._working_directory)
self._suds_options = suds_options
def __init__(self,
request_id,
authorization_data,
poll_interval_in_milliseconds=5000,
environment='production',
**suds_options):
self._request_id = request_id
self._service_client = ServiceClient('BulkService', authorization_data, environment, **suds_options)
self._authorization_data = authorization_data
self._poll_interval_in_milliseconds = poll_interval_in_milliseconds
self._final_status = None
# polls the service until the upload completed, downloads the result file to a temporary directory, and exposes BulkEntity-derived objects
# that contain close representations of the corresponding Campaign Management data objects and value sets.
# Poll for downloads at reasonable intervals. You know your data better than anyone.
# If you download an account that is well less than one million keywords, consider polling
# at 15 to 20 second intervals. If the account contains about one million keywords, consider polling
# at one minute intervals after waiting five minutes. For accounts with about four million keywords,
# consider polling at one minute intervals after waiting 10 minutes.
bulk_service=BulkServiceManager(
authorization_data=authorization_data,
poll_interval_in_milliseconds=5000,
environment=ENVIRONMENT,
)
campaign_service=ServiceClient(
service='CampaignManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=10,
)
customer_service=ServiceClient(
'CustomerManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=9,
)
def authenticate_with_username():
'''
Sets the authentication property of the global AuthorizationData instance with PasswordAuthentication.
# If you are using OAuth in production, CLIENT_ID is required and CLIENT_STATE is recommended.
CLIENT_ID='ClientIdGoesHere'
CLIENT_STATE='ClientStateGoesHere'
ALL_AD_TYPES={
'AdType': ['AppInstall', 'DynamicSearch', 'ExpandedText', 'Product', 'Text']
}
authorization_data=AuthorizationData(
account_id=None,
customer_id=None,
developer_token=DEVELOPER_TOKEN,
authentication=None,
)
campaign_service=ServiceClient(
service='CampaignManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=10,
)
customer_service=ServiceClient(
'CustomerManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=9,
)
def authenticate_with_username():
'''
Sets the authentication property of the global AuthorizationData instance with PasswordAuthentication.
# consider polling at one minute intervals after waiting 10 minutes.
bulk_service=BulkServiceManager(
authorization_data=authorization_data,
poll_interval_in_milliseconds=5000,
environment=ENVIRONMENT,
)
campaign_service=ServiceClient(
service='CampaignManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=10,
)
customer_service=ServiceClient(
'CustomerManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=9,
)
def authenticate_with_username():
'''
Sets the authentication property of the global AuthorizationData instance with PasswordAuthentication.
'''
global authorization_data
authentication=PasswordAuthentication(
user_name='UserNameGoesHere',
password='PasswordGoesHere'
)
DEVELOPER_TOKEN='DeveloperTokenGoesHere'
ENVIRONMENT='production'
# If you are using OAuth in production, CLIENT_ID is required and CLIENT_STATE is recommended.
CLIENT_ID='ClientIdGoesHere'
CLIENT_STATE='ClientStateGoesHere'
authorization_data=AuthorizationData(
account_id=None,
customer_id=None,
developer_token=DEVELOPER_TOKEN,
authentication=None,
)
campaign_service=ServiceClient(
service='CampaignManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=10,
)
customer_service=ServiceClient(
'CustomerManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=9,
)
def authenticate_with_username():
'''
authorization_data=AuthorizationData(
account_id=None,
customer_id=None,
developer_token=DEVELOPER_TOKEN,
authentication=None,
)
campaign_service=ServiceClient(
service='CampaignManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=10,
)
customer_service=ServiceClient(
'CustomerManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=9,
)
def authenticate_with_username():
'''
Sets the authentication property of the global AuthorizationData instance with PasswordAuthentication.
'''
global authorization_data
authentication=PasswordAuthentication(
user_name='UserNameGoesHere',
password='PasswordGoesHere'
)
def __init__(self,
request_id,
authorization_data,
poll_interval_in_milliseconds=5000,
environment='production',
tracking_id=None,
**suds_options):
self._request_id = request_id
self._service_client = ServiceClient('BulkService', 12, authorization_data, environment, **suds_options)
self._authorization_data = authorization_data
self._poll_interval_in_milliseconds = poll_interval_in_milliseconds
self._final_status = None
self.tracking_id=tracking_id
# polls the service until the upload completed, downloads the result file to a temporary directory, and exposes BulkEntity-derived objects
# that contain close representations of the corresponding Campaign Management data objects and value sets.
# Poll for downloads at reasonable intervals. You know your data better than anyone.
# If you download an account that is well less than one million keywords, consider polling
# at 15 to 20 second intervals. If the account contains about one million keywords, consider polling
# at one minute intervals after waiting five minutes. For accounts with about four million keywords,
# consider polling at one minute intervals after waiting 10 minutes.
bulk_service=BulkServiceManager(
authorization_data=authorization_data,
poll_interval_in_milliseconds=5000,
environment=ENVIRONMENT,
)
campaign_service=ServiceClient(
service='CampaignManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=10,
)
customer_service=ServiceClient(
'CustomerManagementService',
authorization_data=authorization_data,
environment=ENVIRONMENT,
version=9,
)
def authenticate_with_username():
'''
Sets the authentication property of the global AuthorizationData instance with PasswordAuthentication.