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\ListInvoicesResponse;
21use Google\Service\DisplayVideo\LookupInvoiceCurrencyResponse;
22
23/**
24 * The "invoices" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $displayvideoService = new Google\Service\DisplayVideo(...);
28 *   $invoices = $displayvideoService->invoices;
29 *  </code>
30 */
31class AdvertisersInvoices extends \Google\Service\Resource
32{
33  /**
34   * Lists invoices posted for an advertiser in a given month. Invoices generated
35   * by billing profiles with a "Partner" invoice level are not retrievable
36   * through this method. (invoices.listAdvertisersInvoices)
37   *
38   * @param string $advertiserId Required. The ID of the advertiser to list
39   * invoices for.
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string issueMonth The month to list the invoices for. If not set,
43   * the request will retrieve invoices for the previous month. Must be in the
44   * format YYYYMM.
45   * @opt_param string loiSapinInvoiceType Select type of invoice to retrieve for
46   * Loi Sapin advertisers. Only applicable to Loi Sapin advertisers. Will be
47   * ignored otherwise.
48   * @opt_param int pageSize Requested page size. Must be between `1` and `100`.
49   * If unspecified will default to `100`. Returns error code `INVALID_ARGUMENT`
50   * if an invalid value is specified.
51   * @opt_param string pageToken A token identifying a page of results the server
52   * should return. Typically, this is the value of next_page_token returned from
53   * the previous call to `ListInvoices` method. If not specified, the first page
54   * of results will be returned.
55   * @return ListInvoicesResponse
56   */
57  public function listAdvertisersInvoices($advertiserId, $optParams = [])
58  {
59    $params = ['advertiserId' => $advertiserId];
60    $params = array_merge($params, $optParams);
61    return $this->call('list', [$params], ListInvoicesResponse::class);
62  }
63  /**
64   * Retrieves the invoice currency used by an advertiser in a given month.
65   * (invoices.lookupInvoiceCurrency)
66   *
67   * @param string $advertiserId Required. The ID of the advertiser to lookup
68   * currency for.
69   * @param array $optParams Optional parameters.
70   *
71   * @opt_param string invoiceMonth Month for which the currency is needed. If not
72   * set, the request will return existing currency settings for the advertiser.
73   * Must be in the format YYYYMM.
74   * @return LookupInvoiceCurrencyResponse
75   */
76  public function lookupInvoiceCurrency($advertiserId, $optParams = [])
77  {
78    $params = ['advertiserId' => $advertiserId];
79    $params = array_merge($params, $optParams);
80    return $this->call('lookupInvoiceCurrency', [$params], LookupInvoiceCurrencyResponse::class);
81  }
82}
83
84// Adding a class alias for backwards compatibility with the previous class name.
85class_alias(AdvertisersInvoices::class, 'Google_Service_DisplayVideo_Resource_AdvertisersInvoices');
86