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\PaymentsResellerSubscription\Resource;
19
20use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse;
21
22/**
23 * The "promotions" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $paymentsresellersubscriptionService = new Google\Service\PaymentsResellerSubscription(...);
27 *   $promotions = $paymentsresellersubscriptionService->promotions;
28 *  </code>
29 */
30class PartnersPromotions extends \Google\Service\Resource
31{
32  /**
33   * Used by partners to list promotions, such as free trial, that can be applied
34   * on subscriptions. It should be called directly by the partner using service
35   * accounts. (promotions.listPartnersPromotions)
36   *
37   * @param string $parent Required. The parent, the partner that can resell.
38   * Format: partners/{partner}
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string filter Optional. Specifies the filters for the promotion
42   * results. The syntax defined in the EBNF grammar:
43   * https://google.aip.dev/assets/misc/ebnf-filtering.txt. Examples: -
44   * applicable_products: "sku1" - region_codes: "US" - applicable_products:
45   * "sku1" AND region_codes: "US"
46   * @opt_param int pageSize Optional. The maximum number of promotions to return.
47   * The service may return fewer than this value. If unspecified, at most 50
48   * products will be returned. The maximum value is 1000; values above 1000 will
49   * be coerced to 1000.
50   * @opt_param string pageToken Optional. A page token, received from a previous
51   * `ListPromotions` call. Provide this to retrieve the subsequent page. When
52   * paginating, all other parameters provided to `ListPromotions` must match the
53   * call that provided the page token.
54   * @return GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse
55   */
56  public function listPartnersPromotions($parent, $optParams = [])
57  {
58    $params = ['parent' => $parent];
59    $params = array_merge($params, $optParams);
60    return $this->call('list', [$params], GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse::class);
61  }
62}
63
64// Adding a class alias for backwards compatibility with the previous class name.
65class_alias(PartnersPromotions::class, 'Google_Service_PaymentsResellerSubscription_Resource_PartnersPromotions');
66