Close httplib2 connections.
Creates a new association between the identified resource and a YouTube asset. Returns the newly-created association. *Warning:* This method is only available to an informed subset of users.
Deletes an existing association between the identified resource and a YouTube asset. *Warning:* This method is only available to an informed subset of users.
Lists the YouTube asset associations linked to the given resource.
list_next(previous_request, previous_response)
Retrieves the next page of results.
close()
Close httplib2 connections.
create(advertiserId, lineItemId, youtubeAssetType, body=None, linkedEntity_adGroupId=None, x__xgafv=None)
Creates a new association between the identified resource and a YouTube asset. Returns the newly-created association. *Warning:* This method is only available to an informed subset of users.
Args:
advertiserId: string, Required. The ID of the advertiser that the linked entity belongs to. (required)
lineItemId: string, The ID of a line item. (required)
youtubeAssetType: string, Required. The type of YouTube asset associated with the resource. (required)
Allowed values
YOUTUBE_ASSET_TYPE_UNSPECIFIED - YouTube asset type is not specified or is unknown in this version.
YOUTUBE_ASSET_TYPE_LOCATION - Location asset.
YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION - Affiliate location asset.
YOUTUBE_ASSET_TYPE_SITELINK - Sitelink asset.
body: object, The request body.
The object takes the form of:
{ # An association between a resource and a YouTube asset.
"linkedYoutubeAsset": { # A YouTube asset linked to a resource in a YoutubeAssetAssociation. # Required. The YouTube asset associated with the resource.
"affiliateLocationAssetFilter": { # An asset filter that matches eligible affiliate location assets for serving. # An affiliate location asset filter. This can be set only when youtube_asset_type is `YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION`.
"affiliateLocationMatchingFunction": { # The matching function for an affiliate location asset filter. # Optional. The matching function that determines how the affiliate location asset filter matches affiliate location assets. This field is required and can only be set for if affiliate_location_matching_type is `SELECTED_CHAINS`.
"chains": [ # Optional. The selected affiliate location chain IDs. This field is required if affiliate_location_matching_type is `SELECTED_CHAINS`.
{ # A chain of affiliate locations.
"chainId": "A String", # Required. ID of the affiliate location chain.
},
],
},
"affiliateLocationMatchingType": "A String", # Required. The matching type of this affiliate location asset filter.
"assetSetId": "A String", # Output only. The ID of the asset set that matches the affiliate location assets eligible for serving.
},
"locationAssetFilter": { # An asset filter that matches eligible location assets for serving. # A location asset filter. This can be set only when youtube_asset_type is `YOUTUBE_ASSET_TYPE_LOCATION`.
"assetSetId": "A String", # Output only. The ID of the asset set that matches the location assets eligible for serving.
"locationMatchingFunction": { # The matching function for a location asset filter. # Optional. The matching function that determines how the location asset filter matches location assets. This field is required and can only be set for if location_matching_type is `FILTER` or `SELECTED_ASSETS`.
"business": "A String", # Optional. The business name to match with. This field is optional and can only be set if location_matching_type is `FILTER`.
"labels": [ # Optional. The labels to match with. Labels are logically OR'ed together. This field is optional and can only be set if location_matching_type is `FILTER`.
"A String",
],
"locationAssetIds": [ # Optional. The selected location asset IDs. This field is required if location_matching_type is `SELECTED_ASSETS`.
"A String",
],
},
"locationMatchingType": "A String", # Required. The matching type of this location asset filter.
},
"sitelinkAsset": { # A sitelink asset. # A sitelink asset. This can be set only when youtube_asset_type is `YOUTUBE_ASSET_TYPE_SITELINK`.
"assetId": "A String", # Required. ID of the sitelink asset.
},
},
"name": "A String", # Identifier. The resource name of the association. For line item-level associations: The name pattern is `advertisers/{advertiser_id}/lineItems/{line_item_id}/youtubeAssetTypes/{youtube_asset_type}/youtubeAssetAssociations/{youtube_asset_association_id}`. For ad group-level associations: The name pattern is `advertisers/{advertiser_id}/adGroups/{ad_group_id}/youtubeAssetTypes/{youtube_asset_type}/youtubeAssetAssociations/{youtube_asset_association_id}`. For `YOUTUBE_ASSET_TYPE_LOCATION` and `YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION` associations: `youtube_asset_association_id` is the ID of the asset set linked, or 0 if the location_matching_type or affiliate_location_matching_type is `DISABLED`. For `YOUTUBE_ASSET_TYPE_SITELINK` associations: `youtube_asset_association_id` is be the ID of the sitelink asset linked.
"youtubeAssetType": "A String", # Required. The type of YouTube asset associated with the resource.
}
linkedEntity_adGroupId: string, The ID of an ad group.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # An association between a resource and a YouTube asset.
"linkedYoutubeAsset": { # A YouTube asset linked to a resource in a YoutubeAssetAssociation. # Required. The YouTube asset associated with the resource.
"affiliateLocationAssetFilter": { # An asset filter that matches eligible affiliate location assets for serving. # An affiliate location asset filter. This can be set only when youtube_asset_type is `YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION`.
"affiliateLocationMatchingFunction": { # The matching function for an affiliate location asset filter. # Optional. The matching function that determines how the affiliate location asset filter matches affiliate location assets. This field is required and can only be set for if affiliate_location_matching_type is `SELECTED_CHAINS`.
"chains": [ # Optional. The selected affiliate location chain IDs. This field is required if affiliate_location_matching_type is `SELECTED_CHAINS`.
{ # A chain of affiliate locations.
"chainId": "A String", # Required. ID of the affiliate location chain.
},
],
},
"affiliateLocationMatchingType": "A String", # Required. The matching type of this affiliate location asset filter.
"assetSetId": "A String", # Output only. The ID of the asset set that matches the affiliate location assets eligible for serving.
},
"locationAssetFilter": { # An asset filter that matches eligible location assets for serving. # A location asset filter. This can be set only when youtube_asset_type is `YOUTUBE_ASSET_TYPE_LOCATION`.
"assetSetId": "A String", # Output only. The ID of the asset set that matches the location assets eligible for serving.
"locationMatchingFunction": { # The matching function for a location asset filter. # Optional. The matching function that determines how the location asset filter matches location assets. This field is required and can only be set for if location_matching_type is `FILTER` or `SELECTED_ASSETS`.
"business": "A String", # Optional. The business name to match with. This field is optional and can only be set if location_matching_type is `FILTER`.
"labels": [ # Optional. The labels to match with. Labels are logically OR'ed together. This field is optional and can only be set if location_matching_type is `FILTER`.
"A String",
],
"locationAssetIds": [ # Optional. The selected location asset IDs. This field is required if location_matching_type is `SELECTED_ASSETS`.
"A String",
],
},
"locationMatchingType": "A String", # Required. The matching type of this location asset filter.
},
"sitelinkAsset": { # A sitelink asset. # A sitelink asset. This can be set only when youtube_asset_type is `YOUTUBE_ASSET_TYPE_SITELINK`.
"assetId": "A String", # Required. ID of the sitelink asset.
},
},
"name": "A String", # Identifier. The resource name of the association. For line item-level associations: The name pattern is `advertisers/{advertiser_id}/lineItems/{line_item_id}/youtubeAssetTypes/{youtube_asset_type}/youtubeAssetAssociations/{youtube_asset_association_id}`. For ad group-level associations: The name pattern is `advertisers/{advertiser_id}/adGroups/{ad_group_id}/youtubeAssetTypes/{youtube_asset_type}/youtubeAssetAssociations/{youtube_asset_association_id}`. For `YOUTUBE_ASSET_TYPE_LOCATION` and `YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION` associations: `youtube_asset_association_id` is the ID of the asset set linked, or 0 if the location_matching_type or affiliate_location_matching_type is `DISABLED`. For `YOUTUBE_ASSET_TYPE_SITELINK` associations: `youtube_asset_association_id` is be the ID of the sitelink asset linked.
"youtubeAssetType": "A String", # Required. The type of YouTube asset associated with the resource.
}
delete(advertiserId, lineItemId, youtubeAssetType, youtubeAssetAssociationId, linkedEntity_adGroupId=None, x__xgafv=None)
Deletes an existing association between the identified resource and a YouTube asset. *Warning:* This method is only available to an informed subset of users.
Args:
advertiserId: string, Required. The ID of the advertiser that the linked entity belongs to. (required)
lineItemId: string, The ID of a line item. (required)
youtubeAssetType: string, Required. The type of YouTube asset associated with the resource. (required)
Allowed values
YOUTUBE_ASSET_TYPE_UNSPECIFIED - YouTube asset type is not specified or is unknown in this version.
YOUTUBE_ASSET_TYPE_LOCATION - Location asset.
YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION - Affiliate location asset.
YOUTUBE_ASSET_TYPE_SITELINK - Sitelink asset.
youtubeAssetAssociationId: string, Required. The ID of the YouTube asset in the association. For `YOUTUBE_ASSET_TYPE_LOCATION` and `YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION` associations: This should be the ID of the asset set linked, or 0 if the location_asset_filter or affiliate_location_asset_filter is `DISABLED`. For `YOUTUBE_ASSET_TYPE_SITELINK` associations: This should be the ID of the sitelink asset linked. (required)
linkedEntity_adGroupId: string, The ID of an ad group.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
}
list(advertiserId, lineItemId, youtubeAssetType, linkedEntity_adGroupId=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists the YouTube asset associations linked to the given resource.
Args:
advertiserId: string, Required. The ID of the advertiser that the linked entity belongs to. (required)
lineItemId: string, The ID of a line item. (required)
youtubeAssetType: string, Required. The type of YouTube asset being associated with the resource. (required)
Allowed values
YOUTUBE_ASSET_TYPE_UNSPECIFIED - YouTube asset type is not specified or is unknown in this version.
YOUTUBE_ASSET_TYPE_LOCATION - Location asset.
YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION - Affiliate location asset.
YOUTUBE_ASSET_TYPE_SITELINK - Sitelink asset.
linkedEntity_adGroupId: string, The ID of an ad group.
orderBy: string, Optional. Field by which to sort the list. The only acceptable values are: * `linkedYoutubeAsset.locationAssetFilter.assetSetId`, * `linkedYoutubeAsset.affiliateLocationAssetFilter.assetSetId`, * `linkedYoutubeAsset.sitelinkAsset.assetId` The default sorting order is ascending. To specify descending order for a field, a suffix " desc" should be added to the field name. Example: `linkedYoutubeAsset.sitelinkAsset.assetId desc`.
pageSize: integer, Optional. Requested page size. Must be between `1` and `10000`. If unspecified will default to `100`. Returns error code `INVALID_ARGUMENT` if an invalid value is specified.
pageToken: string, Optional. A token identifying a page of results the server should return. Typically, this is the value of next_page_token returned from the previous call to `ListYoutubeAssetAssociations` method. If not specified, the first page of results will be returned.
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 YoutubeAssetAssociationService.ListYoutubeAssetAssociations.
"nextPageToken": "A String", # A token to retrieve the next page of results. Pass this value in the page_token field in the subsequent call to `ListYoutubeAssetAssociations` method to retrieve the next page of results.
"youtubeAssetAssociations": [ # The list of asset associations. This list will be absent if empty.
{ # An association between a resource and a YouTube asset.
"linkedYoutubeAsset": { # A YouTube asset linked to a resource in a YoutubeAssetAssociation. # Required. The YouTube asset associated with the resource.
"affiliateLocationAssetFilter": { # An asset filter that matches eligible affiliate location assets for serving. # An affiliate location asset filter. This can be set only when youtube_asset_type is `YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION`.
"affiliateLocationMatchingFunction": { # The matching function for an affiliate location asset filter. # Optional. The matching function that determines how the affiliate location asset filter matches affiliate location assets. This field is required and can only be set for if affiliate_location_matching_type is `SELECTED_CHAINS`.
"chains": [ # Optional. The selected affiliate location chain IDs. This field is required if affiliate_location_matching_type is `SELECTED_CHAINS`.
{ # A chain of affiliate locations.
"chainId": "A String", # Required. ID of the affiliate location chain.
},
],
},
"affiliateLocationMatchingType": "A String", # Required. The matching type of this affiliate location asset filter.
"assetSetId": "A String", # Output only. The ID of the asset set that matches the affiliate location assets eligible for serving.
},
"locationAssetFilter": { # An asset filter that matches eligible location assets for serving. # A location asset filter. This can be set only when youtube_asset_type is `YOUTUBE_ASSET_TYPE_LOCATION`.
"assetSetId": "A String", # Output only. The ID of the asset set that matches the location assets eligible for serving.
"locationMatchingFunction": { # The matching function for a location asset filter. # Optional. The matching function that determines how the location asset filter matches location assets. This field is required and can only be set for if location_matching_type is `FILTER` or `SELECTED_ASSETS`.
"business": "A String", # Optional. The business name to match with. This field is optional and can only be set if location_matching_type is `FILTER`.
"labels": [ # Optional. The labels to match with. Labels are logically OR'ed together. This field is optional and can only be set if location_matching_type is `FILTER`.
"A String",
],
"locationAssetIds": [ # Optional. The selected location asset IDs. This field is required if location_matching_type is `SELECTED_ASSETS`.
"A String",
],
},
"locationMatchingType": "A String", # Required. The matching type of this location asset filter.
},
"sitelinkAsset": { # A sitelink asset. # A sitelink asset. This can be set only when youtube_asset_type is `YOUTUBE_ASSET_TYPE_SITELINK`.
"assetId": "A String", # Required. ID of the sitelink asset.
},
},
"name": "A String", # Identifier. The resource name of the association. For line item-level associations: The name pattern is `advertisers/{advertiser_id}/lineItems/{line_item_id}/youtubeAssetTypes/{youtube_asset_type}/youtubeAssetAssociations/{youtube_asset_association_id}`. For ad group-level associations: The name pattern is `advertisers/{advertiser_id}/adGroups/{ad_group_id}/youtubeAssetTypes/{youtube_asset_type}/youtubeAssetAssociations/{youtube_asset_association_id}`. For `YOUTUBE_ASSET_TYPE_LOCATION` and `YOUTUBE_ASSET_TYPE_AFFILIATE_LOCATION` associations: `youtube_asset_association_id` is the ID of the asset set linked, or 0 if the location_matching_type or affiliate_location_matching_type is `DISABLED`. For `YOUTUBE_ASSET_TYPE_SITELINK` associations: `youtube_asset_association_id` is be the ID of the sitelink asset linked.
"youtubeAssetType": "A String", # Required. The type of YouTube asset associated with the resource.
},
],
}
list_next(previous_request, previous_response)
Retrieves the next page of results. Args: previous_request: The request for the previous page. (required) previous_response: The response from the request for the previous page. (required) Returns: A request object that you can call 'execute()' on to request the next page. Returns None if there are no more items in the collection.