Close httplib2 connections.
mutate(customerId, body=None, x__xgafv=None)
Creates or removes criteria. Operation statuses are returned. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CriterionError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [QuotaError]() [RequestError]()
close()
Close httplib2 connections.
mutate(customerId, body=None, x__xgafv=None)
Creates or removes criteria. Operation statuses are returned. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CriterionError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [QuotaError]() [RequestError]()
Args:
customerId: string, Required. The ID of the customer whose criteria are being modified. (required)
body: object, The request body.
The object takes the form of:
{ # Request message for CustomerNegativeCriterionService.MutateCustomerNegativeCriteria.
"operations": [ # Required. The list of operations to perform on individual criteria.
{ # A single operation (create or remove) on a customer level negative criterion.
"create": { # A negative criterion for exclusions at the customer level. # Create operation: No resource name is expected for the new criterion.
"contentLabel": { # Content Label for category exclusion. # Immutable. ContentLabel.
"type": "A String", # Content label type, required for CREATE operations.
},
"id": "A String", # Output only. The ID of the criterion.
"ipBlock": { # An IpBlock criterion used for excluding IP addresses. We support excluding individual IP addresses or CIDR blocks. Create one IpBlockInfo criterion for each individual IP address or CIDR block you want to exclude. You can exclude up to 500 IP addresses per campaign. For more details, see [Exclude IP addresses](//support.google.com/google-ads/answer/2456098). IPv4 examples: * Individual address: 192.168.0.1 * Individual address as CIDR block: 192.168.0.1/32 * CIDR block: 192.168.0.0/24 IPv6 examples: * Individual address: 2001:db8:a0b:12f0::1 * Individual address as CIDR block: 2001:db8:a0b:12f0::1/128 * CIDR block: 2001:db8::/48 # Immutable. IpBlock. You can exclude up to 500 IP addresses per account.
"ipAddress": "A String", # The IP address or the CIDR block to be excluded.
},
"mobileAppCategory": { # A mobile app category criterion. # Immutable. MobileAppCategory.
"mobileAppCategoryConstant": "A String", # The mobile app category constant resource name.
},
"mobileApplication": { # A mobile application criterion. # Immutable. MobileApplication.
"appId": "A String", # A string that uniquely identifies a mobile application to Google Ads API. The format of this string is "{platform}-{platform_native_id}", where platform is "1" for iOS apps and "2" for Android apps, and where platform_native_id is the mobile application identifier native to the corresponding platform. For iOS, this native identifier is the 9 digit string that appears at the end of an App Store URL (for example, "476943146" for "Flood-It! 2" whose App Store link is "http://itunes.apple.com/us/app/flood-it!-2/id476943146"). For Android, this native identifier is the application's package name (for example, "com.labpixies.colordrips" for "Color Drips" given Google Play link "https://play.google.com/store/apps/details?id=com.labpixies.colordrips"). A well formed app id for Google Ads API would thus be "1-476943146" for iOS and "2-com.labpixies.colordrips" for Android. This field is required and must be set in CREATE operations.
"name": "A String", # Name of this mobile application.
},
"negativeKeywordList": { # A Negative Keyword List criterion. Represents a shared set of negative keywords that can be excluded at the account-level. Only one negative keyword list criterion can be attached per account. # Immutable. NegativeKeywordList.
"sharedSet": "A String", # The NegativeKeywordListInfo shared set resource name.
},
"placement": { # A placement criterion. This can be used to modify bids for sites when targeting the content network. # Immutable. Placement.
"url": "A String", # URL of the placement. For example, "http://www.domain.com".
},
"placementList": { # A Placement List criterion. Represents a shared set of placements that can be excluded at the account-level. # Immutable. PlacementList.
"sharedSet": "A String", # The PlacementListInfo shared set resource name.
},
"resourceName": "A String", # Immutable. The resource name of the customer negative criterion. Customer negative criterion resource names have the form: `customers/{customer_id}/customerNegativeCriteria/{criterion_id}`
"type": "A String", # Output only. The type of the criterion.
"youtubeChannel": { # A YouTube Channel criterion. # Immutable. YouTube Channel.
"channelId": "A String", # The YouTube uploader channel id or the channel code of a YouTube channel.
},
"youtubeVideo": { # A YouTube Video criterion. # Immutable. YouTube Video.
"videoId": "A String", # YouTube video id as it appears on the YouTube watch page.
},
},
"remove": "A String", # Remove operation: A resource name for the removed criterion is expected, in this format: `customers/{customer_id}/customerNegativeCriteria/{criterion_id}`
},
],
"partialFailure": True or False, # If true, successful operations will be carried out and invalid operations will return errors. If false, all operations will be carried out in one transaction if and only if they are all valid. Default is false.
"responseContentType": "A String", # The response content type setting. Determines whether the mutable resource or just the resource name should be returned post mutation.
"validateOnly": True or False, # If true, the request is validated but not executed. Only errors are returned, not results.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for customer negative criterion mutate.
"partialFailureError": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur outside the operations (for example, auth errors), we return an RPC level error.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"results": [ # All results for the mutate.
{ # The result for the criterion mutate.
"customerNegativeCriterion": { # A negative criterion for exclusions at the customer level. # The mutated criterion with only mutable fields after mutate. The field will only be returned when response_content_type is set to "MUTABLE_RESOURCE".
"contentLabel": { # Content Label for category exclusion. # Immutable. ContentLabel.
"type": "A String", # Content label type, required for CREATE operations.
},
"id": "A String", # Output only. The ID of the criterion.
"ipBlock": { # An IpBlock criterion used for excluding IP addresses. We support excluding individual IP addresses or CIDR blocks. Create one IpBlockInfo criterion for each individual IP address or CIDR block you want to exclude. You can exclude up to 500 IP addresses per campaign. For more details, see [Exclude IP addresses](//support.google.com/google-ads/answer/2456098). IPv4 examples: * Individual address: 192.168.0.1 * Individual address as CIDR block: 192.168.0.1/32 * CIDR block: 192.168.0.0/24 IPv6 examples: * Individual address: 2001:db8:a0b:12f0::1 * Individual address as CIDR block: 2001:db8:a0b:12f0::1/128 * CIDR block: 2001:db8::/48 # Immutable. IpBlock. You can exclude up to 500 IP addresses per account.
"ipAddress": "A String", # The IP address or the CIDR block to be excluded.
},
"mobileAppCategory": { # A mobile app category criterion. # Immutable. MobileAppCategory.
"mobileAppCategoryConstant": "A String", # The mobile app category constant resource name.
},
"mobileApplication": { # A mobile application criterion. # Immutable. MobileApplication.
"appId": "A String", # A string that uniquely identifies a mobile application to Google Ads API. The format of this string is "{platform}-{platform_native_id}", where platform is "1" for iOS apps and "2" for Android apps, and where platform_native_id is the mobile application identifier native to the corresponding platform. For iOS, this native identifier is the 9 digit string that appears at the end of an App Store URL (for example, "476943146" for "Flood-It! 2" whose App Store link is "http://itunes.apple.com/us/app/flood-it!-2/id476943146"). For Android, this native identifier is the application's package name (for example, "com.labpixies.colordrips" for "Color Drips" given Google Play link "https://play.google.com/store/apps/details?id=com.labpixies.colordrips"). A well formed app id for Google Ads API would thus be "1-476943146" for iOS and "2-com.labpixies.colordrips" for Android. This field is required and must be set in CREATE operations.
"name": "A String", # Name of this mobile application.
},
"negativeKeywordList": { # A Negative Keyword List criterion. Represents a shared set of negative keywords that can be excluded at the account-level. Only one negative keyword list criterion can be attached per account. # Immutable. NegativeKeywordList.
"sharedSet": "A String", # The NegativeKeywordListInfo shared set resource name.
},
"placement": { # A placement criterion. This can be used to modify bids for sites when targeting the content network. # Immutable. Placement.
"url": "A String", # URL of the placement. For example, "http://www.domain.com".
},
"placementList": { # A Placement List criterion. Represents a shared set of placements that can be excluded at the account-level. # Immutable. PlacementList.
"sharedSet": "A String", # The PlacementListInfo shared set resource name.
},
"resourceName": "A String", # Immutable. The resource name of the customer negative criterion. Customer negative criterion resource names have the form: `customers/{customer_id}/customerNegativeCriteria/{criterion_id}`
"type": "A String", # Output only. The type of the criterion.
"youtubeChannel": { # A YouTube Channel criterion. # Immutable. YouTube Channel.
"channelId": "A String", # The YouTube uploader channel id or the channel code of a YouTube channel.
},
"youtubeVideo": { # A YouTube Video criterion. # Immutable. YouTube Video.
"videoId": "A String", # YouTube video id as it appears on the YouTube watch page.
},
},
"resourceName": "A String", # Returned for successful operations.
},
],
}