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\CloudCommercePartnerProcurementService\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudCommercePartnerProcurementService\ApproveEntitlementPlanChangeRequest;
|
---|
21 | use Google\Service\CloudCommercePartnerProcurementService\ApproveEntitlementRequest;
|
---|
22 | use Google\Service\CloudCommercePartnerProcurementService\CloudcommerceprocurementEmpty;
|
---|
23 | use Google\Service\CloudCommercePartnerProcurementService\Entitlement;
|
---|
24 | use Google\Service\CloudCommercePartnerProcurementService\ListEntitlementsResponse;
|
---|
25 | use Google\Service\CloudCommercePartnerProcurementService\RejectEntitlementPlanChangeRequest;
|
---|
26 | use Google\Service\CloudCommercePartnerProcurementService\RejectEntitlementRequest;
|
---|
27 | use Google\Service\CloudCommercePartnerProcurementService\SuspendEntitlementRequest;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "entitlements" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $cloudcommerceprocurementService = new Google\Service\CloudCommercePartnerProcurementService(...);
|
---|
34 | * $entitlements = $cloudcommerceprocurementService->providers_entitlements;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class ProvidersEntitlements extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Approves an entitlement that is in the
|
---|
41 | * EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED state. This method is
|
---|
42 | * invoked by the provider to approve the creation of the entitlement resource.
|
---|
43 | * (entitlements.approve)
|
---|
44 | *
|
---|
45 | * @param string $name Required. The resource name of the entitlement, with the
|
---|
46 | * format `providers/{providerId}/entitlements/{entitlementId}`.
|
---|
47 | * @param ApproveEntitlementRequest $postBody
|
---|
48 | * @param array $optParams Optional parameters.
|
---|
49 | * @return CloudcommerceprocurementEmpty
|
---|
50 | * @throws \Google\Service\Exception
|
---|
51 | */
|
---|
52 | public function approve($name, ApproveEntitlementRequest $postBody, $optParams = [])
|
---|
53 | {
|
---|
54 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
55 | $params = array_merge($params, $optParams);
|
---|
56 | return $this->call('approve', [$params], CloudcommerceprocurementEmpty::class);
|
---|
57 | }
|
---|
58 | /**
|
---|
59 | * Approves an entitlement plan change that is in the
|
---|
60 | * EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This method
|
---|
61 | * is invoked by the provider to approve the plan change on the entitlement
|
---|
62 | * resource. (entitlements.approvePlanChange)
|
---|
63 | *
|
---|
64 | * @param string $name Required. The resource name of the entitlement.
|
---|
65 | * @param ApproveEntitlementPlanChangeRequest $postBody
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | * @return CloudcommerceprocurementEmpty
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function approvePlanChange($name, ApproveEntitlementPlanChangeRequest $postBody, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('approvePlanChange', [$params], CloudcommerceprocurementEmpty::class);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Gets a requested Entitlement resource. (entitlements.get)
|
---|
78 | *
|
---|
79 | * @param string $name Required. The name of the entitlement to retrieve.
|
---|
80 | * @param array $optParams Optional parameters.
|
---|
81 | * @return Entitlement
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function get($name, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['name' => $name];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('get', [$params], Entitlement::class);
|
---|
89 | }
|
---|
90 | /**
|
---|
91 | * Lists Entitlements for which the provider has read access.
|
---|
92 | * (entitlements.listProvidersEntitlements)
|
---|
93 | *
|
---|
94 | * @param string $parent Required. The parent resource name.
|
---|
95 | * @param array $optParams Optional parameters.
|
---|
96 | *
|
---|
97 | * @opt_param string filter The filter that can be used to limit the list
|
---|
98 | * request. The filter is a query string that can match a selected set of
|
---|
99 | * attributes with string values. For example `account=E-1234-5678-ABCD-EFGH`,
|
---|
100 | * `state=pending_cancellation`, and `plan!=foo-plan`. Supported query
|
---|
101 | * attributes are * `account` * `customer_billing_account` with value in the
|
---|
102 | * format of: `billingAccounts/{id}` * `product_external_name` *
|
---|
103 | * `quote_external_name` * `offer` * `new_pending_offer` * `plan` *
|
---|
104 | * `newPendingPlan` or `new_pending_plan` * `state` * `consumers.project` *
|
---|
105 | * `change_history.new_offer` Note that the consumers and
|
---|
106 | * change_history.new_offer match works on repeated structures, so equality
|
---|
107 | * (`consumers.project=projects/123456789`) is not supported. Set membership can
|
---|
108 | * be expressed with the `:` operator. For example,
|
---|
109 | * `consumers.project:projects/123456789` finds entitlements with at least one
|
---|
110 | * consumer with project field equal to `projects/123456789`.
|
---|
111 | * `change_history.new_offer` retrieves all entitlements that were once
|
---|
112 | * associated or are currently active with the offer. Also note that the state
|
---|
113 | * name match is case-insensitive and query can omit the prefix "ENTITLEMENT_".
|
---|
114 | * For example, `state=active` is equivalent to `state=ENTITLEMENT_ACTIVE`. If
|
---|
115 | * the query contains some special characters other than letters, underscore, or
|
---|
116 | * digits, the phrase must be quoted with double quotes. For example,
|
---|
117 | * `product="providerId:productId"`, where the product name needs to be quoted
|
---|
118 | * because it contains special character colon. Queries can be combined with
|
---|
119 | * `AND`, `OR`, and `NOT` to form more complex queries. They can also be grouped
|
---|
120 | * to force a desired evaluation order. For example, `state=active AND
|
---|
121 | * (account=E-1234 OR account=5678) AND NOT (product=foo-product)`. Connective
|
---|
122 | * `AND` can be omitted between two predicates. For example `account=E-1234
|
---|
123 | * state=active` is equivalent to `account=E-1234 AND state=active`.
|
---|
124 | * @opt_param int pageSize The maximum number of entries that are requested. The
|
---|
125 | * default page size is 200.
|
---|
126 | * @opt_param string pageToken The token for fetching the next page.
|
---|
127 | * @return ListEntitlementsResponse
|
---|
128 | * @throws \Google\Service\Exception
|
---|
129 | */
|
---|
130 | public function listProvidersEntitlements($parent, $optParams = [])
|
---|
131 | {
|
---|
132 | $params = ['parent' => $parent];
|
---|
133 | $params = array_merge($params, $optParams);
|
---|
134 | return $this->call('list', [$params], ListEntitlementsResponse::class);
|
---|
135 | }
|
---|
136 | /**
|
---|
137 | * Updates an existing Entitlement. (entitlements.patch)
|
---|
138 | *
|
---|
139 | * @param string $name Required. The name of the entitlement to update.
|
---|
140 | * @param Entitlement $postBody
|
---|
141 | * @param array $optParams Optional parameters.
|
---|
142 | *
|
---|
143 | * @opt_param string updateMask The update mask that applies to the resource.
|
---|
144 | * See the [FieldMask definition] (https://developers.google.com/protocol-
|
---|
145 | * buffers/docs/reference/google.protobuf#fieldmask) for more details.
|
---|
146 | * @return Entitlement
|
---|
147 | * @throws \Google\Service\Exception
|
---|
148 | */
|
---|
149 | public function patch($name, Entitlement $postBody, $optParams = [])
|
---|
150 | {
|
---|
151 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
152 | $params = array_merge($params, $optParams);
|
---|
153 | return $this->call('patch', [$params], Entitlement::class);
|
---|
154 | }
|
---|
155 | /**
|
---|
156 | * Rejects an entitlement that is in the
|
---|
157 | * EntitlementState.ENTITLEMENT_ACTIVATION_REQUESTED state. This method is
|
---|
158 | * invoked by the provider to reject the creation of the entitlement resource.
|
---|
159 | * (entitlements.reject)
|
---|
160 | *
|
---|
161 | * @param string $name Required. The resource name of the entitlement.
|
---|
162 | * @param RejectEntitlementRequest $postBody
|
---|
163 | * @param array $optParams Optional parameters.
|
---|
164 | * @return CloudcommerceprocurementEmpty
|
---|
165 | * @throws \Google\Service\Exception
|
---|
166 | */
|
---|
167 | public function reject($name, RejectEntitlementRequest $postBody, $optParams = [])
|
---|
168 | {
|
---|
169 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
170 | $params = array_merge($params, $optParams);
|
---|
171 | return $this->call('reject', [$params], CloudcommerceprocurementEmpty::class);
|
---|
172 | }
|
---|
173 | /**
|
---|
174 | * Rejects an entitlement plan change that is in the
|
---|
175 | * EntitlementState.ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This method
|
---|
176 | * is invoked by the provider to reject the plan change on the entitlement
|
---|
177 | * resource. (entitlements.rejectPlanChange)
|
---|
178 | *
|
---|
179 | * @param string $name Required. The resource name of the entitlement.
|
---|
180 | * @param RejectEntitlementPlanChangeRequest $postBody
|
---|
181 | * @param array $optParams Optional parameters.
|
---|
182 | * @return CloudcommerceprocurementEmpty
|
---|
183 | * @throws \Google\Service\Exception
|
---|
184 | */
|
---|
185 | public function rejectPlanChange($name, RejectEntitlementPlanChangeRequest $postBody, $optParams = [])
|
---|
186 | {
|
---|
187 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
188 | $params = array_merge($params, $optParams);
|
---|
189 | return $this->call('rejectPlanChange', [$params], CloudcommerceprocurementEmpty::class);
|
---|
190 | }
|
---|
191 | /**
|
---|
192 | * Requests suspension of an active Entitlement. This is not yet supported.
|
---|
193 | * (entitlements.suspend)
|
---|
194 | *
|
---|
195 | * @param string $name Required. The name of the entitlement to suspend.
|
---|
196 | * @param SuspendEntitlementRequest $postBody
|
---|
197 | * @param array $optParams Optional parameters.
|
---|
198 | * @return CloudcommerceprocurementEmpty
|
---|
199 | * @throws \Google\Service\Exception
|
---|
200 | */
|
---|
201 | public function suspend($name, SuspendEntitlementRequest $postBody, $optParams = [])
|
---|
202 | {
|
---|
203 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
204 | $params = array_merge($params, $optParams);
|
---|
205 | return $this->call('suspend', [$params], CloudcommerceprocurementEmpty::class);
|
---|
206 | }
|
---|
207 | }
|
---|
208 |
|
---|
209 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
210 | class_alias(ProvidersEntitlements::class, 'Google_Service_CloudCommercePartnerProcurementService_Resource_ProvidersEntitlements');
|
---|