[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\PaymentsResellerSubscription\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsRequest;
|
---|
| 21 | use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse;
|
---|
| 22 | use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "promotions" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $paymentsresellersubscriptionService = new Google\Service\PaymentsResellerSubscription(...);
|
---|
| 29 | * $promotions = $paymentsresellersubscriptionService->partners_promotions;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class PartnersPromotions extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * To find eligible promotions for the current user. The API requires user
|
---|
| 36 | * authorization via OAuth. The bare minimum oauth scope `openid` is sufficient,
|
---|
| 37 | * which will skip the consent screen. (promotions.findEligible)
|
---|
| 38 | *
|
---|
| 39 | * @param string $parent Required. The parent, the partner that can resell.
|
---|
| 40 | * Format: partners/{partner}
|
---|
| 41 | * @param GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsRequest $postBody
|
---|
| 42 | * @param array $optParams Optional parameters.
|
---|
| 43 | * @return GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse
|
---|
| 44 | * @throws \Google\Service\Exception
|
---|
| 45 | */
|
---|
| 46 | public function findEligible($parent, GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsRequest $postBody, $optParams = [])
|
---|
| 47 | {
|
---|
| 48 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 49 | $params = array_merge($params, $optParams);
|
---|
| 50 | return $this->call('findEligible', [$params], GoogleCloudPaymentsResellerSubscriptionV1FindEligiblePromotionsResponse::class);
|
---|
| 51 | }
|
---|
| 52 | /**
|
---|
| 53 | * Retrieves the promotions, such as free trial, that can be used by the
|
---|
| 54 | * partner. - This API doesn't apply to YouTube promotions currently. It should
|
---|
| 55 | * be autenticated with a service account. (promotions.listPartnersPromotions)
|
---|
| 56 | *
|
---|
| 57 | * @param string $parent Required. The parent, the partner that can resell.
|
---|
| 58 | * Format: partners/{partner}
|
---|
| 59 | * @param array $optParams Optional parameters.
|
---|
| 60 | *
|
---|
| 61 | * @opt_param string filter Optional. Specifies the filters for the promotion
|
---|
| 62 | * results. The syntax is defined in https://google.aip.dev/160 with the
|
---|
| 63 | * following caveats: 1. Only the following features are supported: - Logical
|
---|
| 64 | * operator `AND` - Comparison operator `=` (no wildcards `*`) - Traversal
|
---|
| 65 | * operator `.` - Has operator `:` (no wildcards `*`) 2. Only the following
|
---|
| 66 | * fields are supported: - `applicableProducts` - `regionCodes` -
|
---|
| 67 | * `youtubePayload.partnerEligibilityId` - `youtubePayload.postalCode` 3. Unless
|
---|
| 68 | * explicitly mentioned above, other features are not supported. Example:
|
---|
| 69 | * `applicableProducts:partners/partner1/products/product1 AND regionCodes:US
|
---|
| 70 | * AND youtubePayload.postalCode=94043 AND
|
---|
| 71 | * youtubePayload.partnerEligibilityId=eligibility-id`
|
---|
| 72 | * @opt_param int pageSize Optional. The maximum number of promotions to return.
|
---|
| 73 | * The service may return fewer than this value. If unspecified, at most 50
|
---|
| 74 | * products will be returned. The maximum value is 1000; values above 1000 will
|
---|
| 75 | * be coerced to 1000.
|
---|
| 76 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
| 77 | * `ListPromotions` call. Provide this to retrieve the subsequent page. When
|
---|
| 78 | * paginating, all other parameters provided to `ListPromotions` must match the
|
---|
| 79 | * call that provided the page token.
|
---|
| 80 | * @return GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse
|
---|
| 81 | * @throws \Google\Service\Exception
|
---|
| 82 | */
|
---|
| 83 | public function listPartnersPromotions($parent, $optParams = [])
|
---|
| 84 | {
|
---|
| 85 | $params = ['parent' => $parent];
|
---|
| 86 | $params = array_merge($params, $optParams);
|
---|
| 87 | return $this->call('list', [$params], GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse::class);
|
---|
| 88 | }
|
---|
| 89 | }
|
---|
| 90 |
|
---|
| 91 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 92 | class_alias(PartnersPromotions::class, 'Google_Service_PaymentsResellerSubscription_Resource_PartnersPromotions');
|
---|