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\InventorySource;
21use Google\Service\DisplayVideo\ListInventorySourcesResponse;
22
23/**
24 * The "inventorySources" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $displayvideoService = new Google\Service\DisplayVideo(...);
28 *   $inventorySources = $displayvideoService->inventorySources;
29 *  </code>
30 */
31class InventorySources extends \Google\Service\Resource
32{
33  /**
34   * Gets an inventory source. (inventorySources.get)
35   *
36   * @param string $inventorySourceId Required. The ID of the inventory source to
37   * fetch.
38   * @param array $optParams Optional parameters.
39   *
40   * @opt_param string partnerId Required. The ID of the DV360 partner to which
41   * the fetched inventory source is permissioned.
42   * @return InventorySource
43   */
44  public function get($inventorySourceId, $optParams = [])
45  {
46    $params = ['inventorySourceId' => $inventorySourceId];
47    $params = array_merge($params, $optParams);
48    return $this->call('get', [$params], InventorySource::class);
49  }
50  /**
51   * Lists inventory sources that are accessible to the current user. The order is
52   * defined by the order_by parameter. If a filter by entity_status is not
53   * specified, inventory sources with entity status `ENTITY_STATUS_ARCHIVED` will
54   * not be included in the results. (inventorySources.listInventorySources)
55   *
56   * @param array $optParams Optional parameters.
57   *
58   * @opt_param string advertiserId The ID of the advertiser that has access to
59   * the inventory source.
60   * @opt_param string filter Allows filtering by inventory source properties.
61   * Supported syntax: * Filter expressions are made up of one or more
62   * restrictions. * Restrictions can be combined by `AND` or `OR` logical
63   * operators. A sequence of restrictions implicitly uses `AND`. * A restriction
64   * has the form of `{field} {operator} {value}`. * The operator must be `EQUALS
65   * (=)`. * Supported fields: - `status.entityStatus` - `commitment` -
66   * `deliveryMethod` - `rateDetails.rateType` - `exchange` Examples: * All active
67   * inventory sources: `status.entityStatus="ENTITY_STATUS_ACTIVE"` * Inventory
68   * sources belonging to Google Ad Manager or Rubicon exchanges:
69   * `exchange="EXCHANGE_GOOGLE_AD_MANAGER" OR exchange="EXCHANGE_RUBICON"` The
70   * length of this field should be no more than 500 characters.
71   * @opt_param string orderBy Field by which to sort the list. Acceptable values
72   * are: * `displayName` (default) The default sorting order is ascending. To
73   * specify descending order for a field, a suffix "desc" should be added to the
74   * field name. For example, `displayName desc`.
75   * @opt_param int pageSize Requested page size. Must be between `1` and `100`.
76   * If unspecified will default to `100`.
77   * @opt_param string pageToken A token identifying a page of results the server
78   * should return. Typically, this is the value of next_page_token returned from
79   * the previous call to `ListInventorySources` method. If not specified, the
80   * first page of results will be returned.
81   * @opt_param string partnerId The ID of the partner that has access to the
82   * inventory source.
83   * @return ListInventorySourcesResponse
84   */
85  public function listInventorySources($optParams = [])
86  {
87    $params = [];
88    $params = array_merge($params, $optParams);
89    return $this->call('list', [$params], ListInventorySourcesResponse::class);
90  }
91}
92
93// Adding a class alias for backwards compatibility with the previous class name.
94class_alias(InventorySources::class, 'Google_Service_DisplayVideo_Resource_InventorySources');
95