# CompanionAds

- [JSON representation](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#SCHEMA_REPRESENTATION)
- [DisplayRequirement](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#DisplayRequirement)
- [Companion](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#Companion)
  - [JSON representation](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#Companion.SCHEMA_REPRESENTATION)
- [IframeAdResource](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#IframeAdResource)
  - [JSON representation](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#IframeAdResource.SCHEMA_REPRESENTATION)
- [StaticAdResource](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#StaticAdResource)
  - [JSON representation](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#StaticAdResource.SCHEMA_REPRESENTATION)
- [HtmlAdResource](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#HtmlAdResource)
  - [JSON representation](https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#HtmlAdResource.SCHEMA_REPRESENTATION)

Metadata for companion ads.

| JSON representation |
|---|
| ``` { "displayRequirement": enum (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#DisplayRequirement`), "companions": [ { object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#Companion`) } ] } ``` |

| Fields ||
|---|---|
| `displayRequirement` | ``enum (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#DisplayRequirement`)`` Indicates how many of the companions should be displayed with the ad. |
| `companions[]` | ``object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#Companion`)`` List of companion ads. |

## DisplayRequirement

Indicates how many of the companions should be displayed with the ad.

| Enums ||
|---|---|
| `DISPLAY_REQUIREMENT_UNSPECIFIED` | Required companions are not specified. The default is ALL. |
| `ALL` | All companions are required to be displayed. |
| `ANY` | At least one of companions needs to be displayed. |
| `NONE` | All companions are optional for display. |

## Companion

Metadata for a companion.

| JSON representation |
|---|
| ``` { "apiFramework": string, "heightPx": integer, "widthPx": integer, "assetHeightPx": integer, "expandedHeightPx": integer, "assetWidthPx": integer, "expandedWidthPx": integer, "adSlotId": string, "events": [ { object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/Event`) } ], // Union field `ad_resource` can be only one of the following: "iframeAdResource": { object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#IframeAdResource`) }, "staticAdResource": { object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#StaticAdResource`) }, "htmlAdResource": { object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#HtmlAdResource`) } // End of list of possible types for union field `ad_resource`. } ``` |

| Fields ||
|---|---|
| `apiFramework` | `string` The API necessary to communicate with the creative if available. |
| `heightPx` | `integer` The pixel height of the placement slot for the intended creative. |
| `widthPx` | `integer` The pixel width of the placement slot for the intended creative. |
| `assetHeightPx` | `integer` The pixel height of the creative. |
| `expandedHeightPx` | `integer` The maximum pixel height of the creative in its expanded state. |
| `assetWidthPx` | `integer` The pixel width of the creative. |
| `expandedWidthPx` | `integer` The maximum pixel width of the creative in its expanded state. |
| `adSlotId` | `string` The ID used to identify the desired placement on a publisher's page. Values to be used should be discussed between publishers and advertisers. |
| `events[]` | ``object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/Event`)`` The list of tracking events for the companion. |
| Union field `ad_resource`. Ad resource associated with the companion ad. `ad_resource` can be only one of the following: ||
| `iframeAdResource` | ``object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#IframeAdResource`)`` The IFrame ad resource associated with the companion ad. |
| `staticAdResource` | ``object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#StaticAdResource`)`` The static ad resource associated with the companion ad. |
| `htmlAdResource` | ``object (`https://docs.cloud.google.com/video-stitcher/docs/reference/rest/v1/CompanionAds#HtmlAdResource`)`` The HTML ad resource associated with the companion ad. |

## IframeAdResource

Metadata for an IFrame ad resource.

| JSON representation |
|---|
| ``` { "uri": string } ``` |

| Fields ||
|---|---|
| `uri` | `string` URI source for an IFrame to display for the ad resource. |

## StaticAdResource

Metadata for a static ad resource.

| JSON representation |
|---|
| ``` { "uri": string, "creativeType": string } ``` |

| Fields ||
|---|---|
| `uri` | `string` URI to the static file for the ad resource. |
| `creativeType` | `string` Describes the MIME type of the ad resource. |

## HtmlAdResource

Metadata for an HTML ad resource.

| JSON representation |
|---|
| ``` { "htmlSource": string } ``` |

| Fields ||
|---|---|
| `htmlSource` | `string` The HTML to display for the ad resource. |