PageRenderTime 26ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/google/apiclient-services/src/PaymentsResellerSubscription/Resource/PartnersSubscriptions.php

https://gitlab.com/Japang-Jawara/jawara-penilaian
PHP | 183 lines | 57 code | 4 blank | 122 comment | 0 complexity | b62380deed88997eae912d8e9cf86050 MD5 | raw file
  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. namespace Google\Service\PaymentsResellerSubscription\Resource;
  18. use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest;
  19. use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse;
  20. use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest;
  21. use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse;
  22. use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest;
  23. use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse;
  24. use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1Subscription;
  25. use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest;
  26. use Google\Service\PaymentsResellerSubscription\GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse;
  27. /**
  28. * The "subscriptions" collection of methods.
  29. * Typical usage is:
  30. * <code>
  31. * $paymentsresellersubscriptionService = new Google\Service\PaymentsResellerSubscription(...);
  32. * $subscriptions = $paymentsresellersubscriptionService->subscriptions;
  33. * </code>
  34. */
  35. class PartnersSubscriptions extends \Google\Service\Resource
  36. {
  37. /**
  38. * Used by partners to cancel a subscription service either immediately or by
  39. * the end of the current billing cycle for their customers. It should be called
  40. * directly by the partner using service accounts. (subscriptions.cancel)
  41. *
  42. * @param string $name Required. The name of the subscription resource to be
  43. * cancelled. It will have the format of
  44. * "partners/{partner_id}/subscriptions/{subscription_id}"
  45. * @param GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest $postBody
  46. * @param array $optParams Optional parameters.
  47. * @return GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse
  48. */
  49. public function cancel($name, GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest $postBody, $optParams = [])
  50. {
  51. $params = ['name' => $name, 'postBody' => $postBody];
  52. $params = array_merge($params, $optParams);
  53. return $this->call('cancel', [$params], GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse::class);
  54. }
  55. /**
  56. * Used by partners to create a subscription for their customers. The created
  57. * subscription is associated with the end user inferred from the end user
  58. * credentials. This API must be authorized by the end user using OAuth.
  59. * (subscriptions.create)
  60. *
  61. * @param string $parent Required. The parent resource name, which is the
  62. * identifier of the partner. It will have the format of
  63. * "partners/{partner_id}".
  64. * @param GoogleCloudPaymentsResellerSubscriptionV1Subscription $postBody
  65. * @param array $optParams Optional parameters.
  66. *
  67. * @opt_param string subscriptionId Required. Identifies the subscription
  68. * resource on the Partner side. The value is restricted to 63 ASCII characters
  69. * at the maximum. If a subscription was previously created with the same
  70. * subscription_id, we will directly return that one.
  71. * @return GoogleCloudPaymentsResellerSubscriptionV1Subscription
  72. */
  73. public function create($parent, GoogleCloudPaymentsResellerSubscriptionV1Subscription $postBody, $optParams = [])
  74. {
  75. $params = ['parent' => $parent, 'postBody' => $postBody];
  76. $params = array_merge($params, $optParams);
  77. return $this->call('create', [$params], GoogleCloudPaymentsResellerSubscriptionV1Subscription::class);
  78. }
  79. /**
  80. * Used by partners to entitle a previously provisioned subscription to the
  81. * current end user. The end user identity is inferred from the authorized
  82. * credential of the request. This API must be authorized by the end user using
  83. * OAuth. (subscriptions.entitle)
  84. *
  85. * @param string $name Required. The name of the subscription resource that is
  86. * entitled to the current end user. It will have the format of
  87. * "partners/{partner_id}/subscriptions/{subscription_id}"
  88. * @param GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest $postBody
  89. * @param array $optParams Optional parameters.
  90. * @return GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse
  91. */
  92. public function entitle($name, GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest $postBody, $optParams = [])
  93. {
  94. $params = ['name' => $name, 'postBody' => $postBody];
  95. $params = array_merge($params, $optParams);
  96. return $this->call('entitle', [$params], GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse::class);
  97. }
  98. /**
  99. * Used by partners to extend a subscription service for their customers on an
  100. * ongoing basis for the subscription to remain active and renewable. It should
  101. * be called directly by the partner using service accounts.
  102. * (subscriptions.extend)
  103. *
  104. * @param string $name Required. The name of the subscription resource to be
  105. * extended. It will have the format of
  106. * "partners/{partner_id}/subscriptions/{subscription_id}".
  107. * @param GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest $postBody
  108. * @param array $optParams Optional parameters.
  109. * @return GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse
  110. */
  111. public function extend($name, GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest $postBody, $optParams = [])
  112. {
  113. $params = ['name' => $name, 'postBody' => $postBody];
  114. $params = array_merge($params, $optParams);
  115. return $this->call('extend', [$params], GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse::class);
  116. }
  117. /**
  118. * Used by partners to get a subscription by id. It should be called directly by
  119. * the partner using service accounts. (subscriptions.get)
  120. *
  121. * @param string $name Required. The name of the subscription resource to
  122. * retrieve. It will have the format of
  123. * "partners/{partner_id}/subscriptions/{subscription_id}"
  124. * @param array $optParams Optional parameters.
  125. * @return GoogleCloudPaymentsResellerSubscriptionV1Subscription
  126. */
  127. public function get($name, $optParams = [])
  128. {
  129. $params = ['name' => $name];
  130. $params = array_merge($params, $optParams);
  131. return $this->call('get', [$params], GoogleCloudPaymentsResellerSubscriptionV1Subscription::class);
  132. }
  133. /**
  134. * Used by partners to provision a subscription for their customers. This
  135. * creates a subscription without associating it with the end user account.
  136. * EntitleSubscription must be called separately using OAuth in order for the
  137. * end user account to be associated with the subscription. It should be called
  138. * directly by the partner using service accounts. (subscriptions.provision)
  139. *
  140. * @param string $parent Required. The parent resource name, which is the
  141. * identifier of the partner. It will have the format of
  142. * "partners/{partner_id}".
  143. * @param GoogleCloudPaymentsResellerSubscriptionV1Subscription $postBody
  144. * @param array $optParams Optional parameters.
  145. *
  146. * @opt_param string subscriptionId Required. Identifies the subscription
  147. * resource on the Partner side. The value is restricted to 63 ASCII characters
  148. * at the maximum. If a subscription was previously created with the same
  149. * subscription_id, we will directly return that one.
  150. * @return GoogleCloudPaymentsResellerSubscriptionV1Subscription
  151. */
  152. public function provision($parent, GoogleCloudPaymentsResellerSubscriptionV1Subscription $postBody, $optParams = [])
  153. {
  154. $params = ['parent' => $parent, 'postBody' => $postBody];
  155. $params = array_merge($params, $optParams);
  156. return $this->call('provision', [$params], GoogleCloudPaymentsResellerSubscriptionV1Subscription::class);
  157. }
  158. /**
  159. * Used by partners to revoke the pending cancellation of a subscription, which
  160. * is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is
  161. * already cancelled, the request will fail. It should be called directly by the
  162. * partner using service accounts. (subscriptions.undoCancel)
  163. *
  164. * @param string $name Required. The name of the subscription resource whose
  165. * pending cancellation needs to be undone. It will have the format of
  166. * "partners/{partner_id}/subscriptions/{subscription_id}"
  167. * @param GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest $postBody
  168. * @param array $optParams Optional parameters.
  169. * @return GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse
  170. */
  171. public function undoCancel($name, GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest $postBody, $optParams = [])
  172. {
  173. $params = ['name' => $name, 'postBody' => $postBody];
  174. $params = array_merge($params, $optParams);
  175. return $this->call('undoCancel', [$params], GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse::class);
  176. }
  177. }
  178. // Adding a class alias for backwards compatibility with the previous class name.
  179. class_alias(PartnersSubscriptions::class, 'Google_Service_PaymentsResellerSubscription_Resource_PartnersSubscriptions');