# Search Ads 360 Reporting API . customers . campaignAssets

## Instance Methods

Close httplib2 connections.

Creates or removes campaign assets. Operation statuses are returned. List of thrown errors: [AssetLinkError]() [AuthenticationError]() [AuthorizationError]() [ContextError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [NotAllowlistedError]() [QuotaError]() [RequestError]()

### Method Details

`close()`

    Close httplib2 connections.

`mutate(customerId, body=None, x__xgafv=None)`

    Creates or removes campaign assets. Operation statuses are returned. List of thrown errors: [AssetLinkError]() [AuthenticationError]() [AuthorizationError]() [ContextError]() [DatabaseError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [NotAllowlistedError]() [QuotaError]() [RequestError]()

    Args:
      customerId: string, Required. The ID of the customer whose campaign assets are being modified. (required)
      body: object, The request body.
        The object takes the form of:

    { # Request message for CampaignAssetService.MutateCampaignAssets.
      "operations": [ # Required. The list of operations to perform on individual campaign assets.
        { # A single operation (create, remove) on a campaign asset.
          "create": { # A link between a Campaign and an Asset. # Create operation: No resource name is expected for the new campaign asset.
            "asset": "A String", # Immutable. The asset which is linked to the campaign.
            "campaign": "A String", # Immutable. The campaign to which the asset is linked.
            "fieldType": "A String", # Immutable. Role that the asset takes under the linked campaign. Required.
            "primaryStatus": "A String", # Output only. Provides the PrimaryStatus of this asset link. Primary status is meant essentially to differentiate between the plain "status" field, which has advertiser set values of enabled, paused, or removed. The primary status takes into account other signals (for assets its mainly policy and quality approvals) to come up with a more comprehensive status to indicate its serving state.
            "primaryStatusDetails": [ # Output only. Provides the details of the primary status and its associated reasons.
              { # Provides the detail of a PrimaryStatus. Each asset link has a PrimaryStatus value (e.g. NOT_ELIGIBLE, meaning not serving), and list of corroborating PrimaryStatusReasons (e.g. [ASSET_DISAPPROVED]). Each reason may have some additional details annotated with it. For instance, when the reason is ASSET_DISAPPROVED, the details field will contain additional information about the offline evaluation errors which led to the asset being disapproved.
                "assetDisapproved": { # Details related to AssetLinkPrimaryStatusReasonPB.ASSET_DISAPPROVED # Provides the details for AssetLinkPrimaryStatusReason.ASSET_DISAPPROVED
                  "offlineEvaluationErrorReasons": [ # Provides the quality evaluation disapproval reason of an asset.
                    "A String",
                  ],
                },
                "reason": "A String", # Provides the reason of this PrimaryStatus.
                "status": "A String", # Provides the PrimaryStatus of this status detail.
              },
            ],
            "primaryStatusReasons": [ # Output only. Provides a list of reasons for why an asset is not serving or not serving at full capacity.
              "A String",
            ],
            "resourceName": "A String", # Immutable. The resource name of the campaign asset. CampaignAsset resource names have the form: `customers/{customer_id}/campaignAssets/{campaign_id}~{asset_id}~{field_type}`
            "source": "A String", # Output only. Source of the campaign asset link.
            "status": "A String", # Status of the campaign asset.
          },
          "remove": "A String", # Remove operation: A resource name for the removed campaign asset is expected, in this format: `customers/{customer_id}/campaignAssets/{campaign_id}~{asset_id}~{field_type}`
          "update": { # A link between a Campaign and an Asset. # Update operation: The campaign asset is expected to have a valid resource name.
            "asset": "A String", # Immutable. The asset which is linked to the campaign.
            "campaign": "A String", # Immutable. The campaign to which the asset is linked.
            "fieldType": "A String", # Immutable. Role that the asset takes under the linked campaign. Required.
            "primaryStatus": "A String", # Output only. Provides the PrimaryStatus of this asset link. Primary status is meant essentially to differentiate between the plain "status" field, which has advertiser set values of enabled, paused, or removed. The primary status takes into account other signals (for assets its mainly policy and quality approvals) to come up with a more comprehensive status to indicate its serving state.
            "primaryStatusDetails": [ # Output only. Provides the details of the primary status and its associated reasons.
              { # Provides the detail of a PrimaryStatus. Each asset link has a PrimaryStatus value (e.g. NOT_ELIGIBLE, meaning not serving), and list of corroborating PrimaryStatusReasons (e.g. [ASSET_DISAPPROVED]). Each reason may have some additional details annotated with it. For instance, when the reason is ASSET_DISAPPROVED, the details field will contain additional information about the offline evaluation errors which led to the asset being disapproved.
                "assetDisapproved": { # Details related to AssetLinkPrimaryStatusReasonPB.ASSET_DISAPPROVED # Provides the details for AssetLinkPrimaryStatusReason.ASSET_DISAPPROVED
                  "offlineEvaluationErrorReasons": [ # Provides the quality evaluation disapproval reason of an asset.
                    "A String",
                  ],
                },
                "reason": "A String", # Provides the reason of this PrimaryStatus.
                "status": "A String", # Provides the PrimaryStatus of this status detail.
              },
            ],
            "primaryStatusReasons": [ # Output only. Provides a list of reasons for why an asset is not serving or not serving at full capacity.
              "A String",
            ],
            "resourceName": "A String", # Immutable. The resource name of the campaign asset. CampaignAsset resource names have the form: `customers/{customer_id}/campaignAssets/{campaign_id}~{asset_id}~{field_type}`
            "source": "A String", # Output only. Source of the campaign asset link.
            "status": "A String", # Status of the campaign asset.
          },
          "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 a campaign asset 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 asset mutate.
          "campaignAsset": { # A link between a Campaign and an Asset. # The mutated campaign asset with only mutable fields after mutate. The field will only be returned when response_content_type is set to "MUTABLE_RESOURCE".
            "asset": "A String", # Immutable. The asset which is linked to the campaign.
            "campaign": "A String", # Immutable. The campaign to which the asset is linked.
            "fieldType": "A String", # Immutable. Role that the asset takes under the linked campaign. Required.
            "primaryStatus": "A String", # Output only. Provides the PrimaryStatus of this asset link. Primary status is meant essentially to differentiate between the plain "status" field, which has advertiser set values of enabled, paused, or removed. The primary status takes into account other signals (for assets its mainly policy and quality approvals) to come up with a more comprehensive status to indicate its serving state.
            "primaryStatusDetails": [ # Output only. Provides the details of the primary status and its associated reasons.
              { # Provides the detail of a PrimaryStatus. Each asset link has a PrimaryStatus value (e.g. NOT_ELIGIBLE, meaning not serving), and list of corroborating PrimaryStatusReasons (e.g. [ASSET_DISAPPROVED]). Each reason may have some additional details annotated with it. For instance, when the reason is ASSET_DISAPPROVED, the details field will contain additional information about the offline evaluation errors which led to the asset being disapproved.
                "assetDisapproved": { # Details related to AssetLinkPrimaryStatusReasonPB.ASSET_DISAPPROVED # Provides the details for AssetLinkPrimaryStatusReason.ASSET_DISAPPROVED
                  "offlineEvaluationErrorReasons": [ # Provides the quality evaluation disapproval reason of an asset.
                    "A String",
                  ],
                },
                "reason": "A String", # Provides the reason of this PrimaryStatus.
                "status": "A String", # Provides the PrimaryStatus of this status detail.
              },
            ],
            "primaryStatusReasons": [ # Output only. Provides a list of reasons for why an asset is not serving or not serving at full capacity.
              "A String",
            ],
            "resourceName": "A String", # Immutable. The resource name of the campaign asset. CampaignAsset resource names have the form: `customers/{customer_id}/campaignAssets/{campaign_id}~{asset_id}~{field_type}`
            "source": "A String", # Output only. Source of the campaign asset link.
            "status": "A String", # Status of the campaign asset.
          },
          "resourceName": "A String", # Returned for successful operations.
        },
      ],
    }