Close httplib2 connections.
mutate(customerId, body=None, x__xgafv=None)
Creates, updates, or removes campaign budgets. Operation statuses are returned. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignBudgetError]() [DatabaseError]() [DistinctError]() [FieldError]() [FieldMaskError]() [HeaderError]() [InternalError]() [MutateError]() [NewResourceCreationError]() [OperationAccessDeniedError]() [QuotaError]() [RangeError]() [RequestError]() [ResourceCountLimitExceededError]() [StringLengthError]()
close()
Close httplib2 connections.
mutate(customerId, body=None, x__xgafv=None)
Creates, updates, or removes campaign budgets. Operation statuses are returned. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CampaignBudgetError]() [DatabaseError]() [DistinctError]() [FieldError]() [FieldMaskError]() [HeaderError]() [InternalError]() [MutateError]() [NewResourceCreationError]() [OperationAccessDeniedError]() [QuotaError]() [RangeError]() [RequestError]() [ResourceCountLimitExceededError]() [StringLengthError]()
Args:
customerId: string, Required. The ID of the customer whose campaign budgets are being modified. (required)
body: object, The request body.
The object takes the form of:
{ # Request message for CampaignBudgetService.MutateCampaignBudgets.
"operations": [ # Required. The list of operations to perform on individual campaign budgets.
{ # A single operation (create, update, remove) on a campaign budget.
"create": { # A campaign budget. # Create operation: No resource name is expected for the new budget.
"alignedBiddingStrategyId": "A String", # ID of the portfolio bidding strategy that this shared campaign budget is aligned with. When a bidding strategy and a campaign budget are aligned, they are attached to the same set of campaigns. After a campaign budget is aligned with a bidding strategy, campaigns that are added to the campaign budget must also use the aligned bidding strategy.
"amountMicros": "A String", # The average daily amount to be spent by the campaign. This field is used when the CampaignBudget `period` is set to `DAILY`, which is the default. Amount is specified in micros in the account's local currency. One million micros is equivalent to one currency unit. The effective monthly spend is capped at 30.4 times this daily amount. This field is mutually exclusive with 'total_amount_micros'. Only one of 'amount_micros' or 'total_amount_micros' should be set.
"deliveryMethod": "A String", # The delivery method that determines the rate at which the campaign budget is spent. Defaults to STANDARD if unspecified in a create operation.
"explicitlyShared": True or False, # Specifies whether the budget is explicitly shared. Defaults to true if unspecified in a create operation. If true, the budget was created with the purpose of sharing across one or more campaigns. If false, the budget was created with the intention of only being used with a single campaign. The budget's name and status will stay in sync with the campaign's name and status. Attempting to share the budget with a second campaign will result in an error. A non-shared budget can become an explicitly shared. The same operation must also assign the budget a name. A shared campaign budget can never become non-shared.
"hasRecommendedBudget": True or False, # Output only. Indicates whether there is a recommended budget for this campaign budget. This field is read-only.
"id": "A String", # Output only. The ID of the campaign budget. A campaign budget is created using the CampaignBudgetService create operation and is assigned a budget ID. A budget ID can be shared across different campaigns; the system will then allocate the campaign budget among different campaigns to get optimum results.
"name": "A String", # The name of the campaign budget. When creating a campaign budget through CampaignBudgetService, every explicitly shared campaign budget must have a non-null, non-empty name. Campaign budgets that are not explicitly shared derive their name from the attached campaign's name. The length of this string must be between 1 and 255, inclusive, in UTF-8 bytes, (trimmed).
"period": "A String", # Immutable. Period over which to spend the budget. Defaults to DAILY if not specified.
"recommendedBudgetAmountMicros": "A String", # Output only. The recommended budget amount. If no recommendation is available, this will be set to the budget amount. Amount is specified in micros, where one million is equivalent to one currency unit. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyClicks": "A String", # Output only. The estimated change in weekly clicks if the recommended budget is applied. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyCostMicros": "A String", # Output only. The estimated change in weekly cost in micros if the recommended budget is applied. One million is equivalent to one currency unit. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyInteractions": "A String", # Output only. The estimated change in weekly interactions if the recommended budget is applied. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyViews": "A String", # Output only. The estimated change in weekly views if the recommended budget is applied. This field is read-only.
"referenceCount": "A String", # Output only. The number of campaigns actively using the budget. This field is read-only.
"resourceName": "A String", # Immutable. The resource name of the campaign budget. Campaign budget resource names have the form: `customers/{customer_id}/campaignBudgets/{campaign_budget_id}`
"status": "A String", # Output only. The status of this campaign budget. This field is read-only.
"totalAmountMicros": "A String", # The total amount to be spent by the campaign over its entire duration. This field is used *only* when the CampaignBudget `period` is set to `CUSTOM_PERIOD`. It represents the budget cap for the campaign's lifetime, rather than a daily limit. The amount is specified in micros in the account's local currency. One million micros is equivalent to one currency unit. This field is mutually exclusive with 'amount_micros'. Only one of 'total_amount_micros' or 'amount_micros' should be set.
"type": "A String", # Immutable. The type of the campaign budget.
},
"remove": "A String", # Remove operation: A resource name for the removed budget is expected, in this format: `customers/{customer_id}/campaignBudgets/{budget_id}`
"update": { # A campaign budget. # Update operation: The campaign budget is expected to have a valid resource name.
"alignedBiddingStrategyId": "A String", # ID of the portfolio bidding strategy that this shared campaign budget is aligned with. When a bidding strategy and a campaign budget are aligned, they are attached to the same set of campaigns. After a campaign budget is aligned with a bidding strategy, campaigns that are added to the campaign budget must also use the aligned bidding strategy.
"amountMicros": "A String", # The average daily amount to be spent by the campaign. This field is used when the CampaignBudget `period` is set to `DAILY`, which is the default. Amount is specified in micros in the account's local currency. One million micros is equivalent to one currency unit. The effective monthly spend is capped at 30.4 times this daily amount. This field is mutually exclusive with 'total_amount_micros'. Only one of 'amount_micros' or 'total_amount_micros' should be set.
"deliveryMethod": "A String", # The delivery method that determines the rate at which the campaign budget is spent. Defaults to STANDARD if unspecified in a create operation.
"explicitlyShared": True or False, # Specifies whether the budget is explicitly shared. Defaults to true if unspecified in a create operation. If true, the budget was created with the purpose of sharing across one or more campaigns. If false, the budget was created with the intention of only being used with a single campaign. The budget's name and status will stay in sync with the campaign's name and status. Attempting to share the budget with a second campaign will result in an error. A non-shared budget can become an explicitly shared. The same operation must also assign the budget a name. A shared campaign budget can never become non-shared.
"hasRecommendedBudget": True or False, # Output only. Indicates whether there is a recommended budget for this campaign budget. This field is read-only.
"id": "A String", # Output only. The ID of the campaign budget. A campaign budget is created using the CampaignBudgetService create operation and is assigned a budget ID. A budget ID can be shared across different campaigns; the system will then allocate the campaign budget among different campaigns to get optimum results.
"name": "A String", # The name of the campaign budget. When creating a campaign budget through CampaignBudgetService, every explicitly shared campaign budget must have a non-null, non-empty name. Campaign budgets that are not explicitly shared derive their name from the attached campaign's name. The length of this string must be between 1 and 255, inclusive, in UTF-8 bytes, (trimmed).
"period": "A String", # Immutable. Period over which to spend the budget. Defaults to DAILY if not specified.
"recommendedBudgetAmountMicros": "A String", # Output only. The recommended budget amount. If no recommendation is available, this will be set to the budget amount. Amount is specified in micros, where one million is equivalent to one currency unit. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyClicks": "A String", # Output only. The estimated change in weekly clicks if the recommended budget is applied. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyCostMicros": "A String", # Output only. The estimated change in weekly cost in micros if the recommended budget is applied. One million is equivalent to one currency unit. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyInteractions": "A String", # Output only. The estimated change in weekly interactions if the recommended budget is applied. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyViews": "A String", # Output only. The estimated change in weekly views if the recommended budget is applied. This field is read-only.
"referenceCount": "A String", # Output only. The number of campaigns actively using the budget. This field is read-only.
"resourceName": "A String", # Immutable. The resource name of the campaign budget. Campaign budget resource names have the form: `customers/{customer_id}/campaignBudgets/{campaign_budget_id}`
"status": "A String", # Output only. The status of this campaign budget. This field is read-only.
"totalAmountMicros": "A String", # The total amount to be spent by the campaign over its entire duration. This field is used *only* when the CampaignBudget `period` is set to `CUSTOM_PERIOD`. It represents the budget cap for the campaign's lifetime, rather than a daily limit. The amount is specified in micros in the account's local currency. One million micros is equivalent to one currency unit. This field is mutually exclusive with 'amount_micros'. Only one of 'total_amount_micros' or 'amount_micros' should be set.
"type": "A String", # Immutable. The type of the campaign budget.
},
"updateMask": "A String", # FieldMask that determines which resource fields are modified in an update.
},
],
"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 campaign budget 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 campaign budget mutate.
"campaignBudget": { # A campaign budget. # The mutated campaign budget with only mutable fields after mutate. The field will only be returned when response_content_type is set to "MUTABLE_RESOURCE".
"alignedBiddingStrategyId": "A String", # ID of the portfolio bidding strategy that this shared campaign budget is aligned with. When a bidding strategy and a campaign budget are aligned, they are attached to the same set of campaigns. After a campaign budget is aligned with a bidding strategy, campaigns that are added to the campaign budget must also use the aligned bidding strategy.
"amountMicros": "A String", # The average daily amount to be spent by the campaign. This field is used when the CampaignBudget `period` is set to `DAILY`, which is the default. Amount is specified in micros in the account's local currency. One million micros is equivalent to one currency unit. The effective monthly spend is capped at 30.4 times this daily amount. This field is mutually exclusive with 'total_amount_micros'. Only one of 'amount_micros' or 'total_amount_micros' should be set.
"deliveryMethod": "A String", # The delivery method that determines the rate at which the campaign budget is spent. Defaults to STANDARD if unspecified in a create operation.
"explicitlyShared": True or False, # Specifies whether the budget is explicitly shared. Defaults to true if unspecified in a create operation. If true, the budget was created with the purpose of sharing across one or more campaigns. If false, the budget was created with the intention of only being used with a single campaign. The budget's name and status will stay in sync with the campaign's name and status. Attempting to share the budget with a second campaign will result in an error. A non-shared budget can become an explicitly shared. The same operation must also assign the budget a name. A shared campaign budget can never become non-shared.
"hasRecommendedBudget": True or False, # Output only. Indicates whether there is a recommended budget for this campaign budget. This field is read-only.
"id": "A String", # Output only. The ID of the campaign budget. A campaign budget is created using the CampaignBudgetService create operation and is assigned a budget ID. A budget ID can be shared across different campaigns; the system will then allocate the campaign budget among different campaigns to get optimum results.
"name": "A String", # The name of the campaign budget. When creating a campaign budget through CampaignBudgetService, every explicitly shared campaign budget must have a non-null, non-empty name. Campaign budgets that are not explicitly shared derive their name from the attached campaign's name. The length of this string must be between 1 and 255, inclusive, in UTF-8 bytes, (trimmed).
"period": "A String", # Immutable. Period over which to spend the budget. Defaults to DAILY if not specified.
"recommendedBudgetAmountMicros": "A String", # Output only. The recommended budget amount. If no recommendation is available, this will be set to the budget amount. Amount is specified in micros, where one million is equivalent to one currency unit. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyClicks": "A String", # Output only. The estimated change in weekly clicks if the recommended budget is applied. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyCostMicros": "A String", # Output only. The estimated change in weekly cost in micros if the recommended budget is applied. One million is equivalent to one currency unit. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyInteractions": "A String", # Output only. The estimated change in weekly interactions if the recommended budget is applied. This field is read-only.
"recommendedBudgetEstimatedChangeWeeklyViews": "A String", # Output only. The estimated change in weekly views if the recommended budget is applied. This field is read-only.
"referenceCount": "A String", # Output only. The number of campaigns actively using the budget. This field is read-only.
"resourceName": "A String", # Immutable. The resource name of the campaign budget. Campaign budget resource names have the form: `customers/{customer_id}/campaignBudgets/{campaign_budget_id}`
"status": "A String", # Output only. The status of this campaign budget. This field is read-only.
"totalAmountMicros": "A String", # The total amount to be spent by the campaign over its entire duration. This field is used *only* when the CampaignBudget `period` is set to `CUSTOM_PERIOD`. It represents the budget cap for the campaign's lifetime, rather than a daily limit. The amount is specified in micros in the account's local currency. One million micros is equivalent to one currency unit. This field is mutually exclusive with 'amount_micros'. Only one of 'total_amount_micros' or 'amount_micros' should be set.
"type": "A String", # Immutable. The type of the campaign budget.
},
"resourceName": "A String", # Returned for successful operations.
},
],
}