1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\DisplayVideo\Resource;
19
20use Google\Service\DisplayVideo\GoogleAudience;
21use Google\Service\DisplayVideo\ListGoogleAudiencesResponse;
22
23/**
24 * The "googleAudiences" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $displayvideoService = new Google\Service\DisplayVideo(...);
28 *   $googleAudiences = $displayvideoService->googleAudiences;
29 *  </code>
30 */
31class GoogleAudiences extends \Google\Service\Resource
32{
33  /**
34   * Gets a Google audience. (googleAudiences.get)
35   *
36   * @param string $googleAudienceId Required. The ID of the Google audience to
37   * fetch.
38   * @param array $optParams Optional parameters.
39   *
40   * @opt_param string advertiserId The ID of the advertiser that has access to
41   * the fetched Google audience.
42   * @opt_param string partnerId The ID of the partner that has access to the
43   * fetched Google audience.
44   * @return GoogleAudience
45   */
46  public function get($googleAudienceId, $optParams = [])
47  {
48    $params = ['googleAudienceId' => $googleAudienceId];
49    $params = array_merge($params, $optParams);
50    return $this->call('get', [$params], GoogleAudience::class);
51  }
52  /**
53   * Lists Google audiences. The order is defined by the order_by parameter.
54   * (googleAudiences.listGoogleAudiences)
55   *
56   * @param array $optParams Optional parameters.
57   *
58   * @opt_param string advertiserId The ID of the advertiser that has access to
59   * the fetched Google audiences.
60   * @opt_param string filter Allows filtering by Google audience fields.
61   * Supported syntax: * Filter expressions for Google audiences currently can
62   * only contain at most one restriction. * A restriction has the form of
63   * `{field} {operator} {value}`. * The operator must be `CONTAINS (:)`. *
64   * Supported fields: - `displayName` Examples: * All Google audiences for which
65   * the display name contains "Google": `displayName : "Google"`. The length of
66   * this field should be no more than 500 characters.
67   * @opt_param string orderBy Field by which to sort the list. Acceptable values
68   * are: * `googleAudienceId` (default) * `displayName` The default sorting order
69   * is ascending. To specify descending order for a field, a suffix "desc" should
70   * be added to the field name. Example: `displayName desc`.
71   * @opt_param int pageSize Requested page size. Must be between `1` and `100`.
72   * If unspecified will default to `100`. Returns error code `INVALID_ARGUMENT`
73   * if an invalid value is specified.
74   * @opt_param string pageToken A token identifying a page of results the server
75   * should return. Typically, this is the value of next_page_token returned from
76   * the previous call to `ListGoogleAudiences` method. If not specified, the
77   * first page of results will be returned.
78   * @opt_param string partnerId The ID of the partner that has access to the
79   * fetched Google audiences.
80   * @return ListGoogleAudiencesResponse
81   */
82  public function listGoogleAudiences($optParams = [])
83  {
84    $params = [];
85    $params = array_merge($params, $optParams);
86    return $this->call('list', [$params], ListGoogleAudiencesResponse::class);
87  }
88}
89
90// Adding a class alias for backwards compatibility with the previous class name.
91class_alias(GoogleAudiences::class, 'Google_Service_DisplayVideo_Resource_GoogleAudiences');
92