Google_SubscriptionsServiceResource
The "subscriptions" collection of methods.
Defined (3)
The class is defined in the following location(s).
- /google-api/src/contrib/Google_MirrorService.php
- class Google_SubscriptionsServiceResource extends Google_ServiceResource {
- /**
- * Deletes a subscription. (subscriptions.delete)
- *
- * @param string $id The ID of the subscription.
- * @param array $optParams Optional parameters.
- */
- public function delete($id, $optParams = array()) {
- $params = array('id' => $id);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- /**
- * Creates a new subscription. (subscriptions.insert)
- *
- * @param Google_Subscription $postBody
- * @param array $optParams Optional parameters.
- * @return Google_Subscription
- */
- public function insert(Google_Subscription $postBody, $optParams = array()) {
- $params = array('postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert', array($params));
- if ($this->useObjects()) {
- return new Google_Subscription($data);
- } else {
- return $data;
- }
- }
- /**
- * Retrieves a list of subscriptions for the authenticated user and service. (subscriptions.list)
- *
- * @param array $optParams Optional parameters.
- * @return Google_SubscriptionsListResponse
- */
- public function listSubscriptions($optParams = array()) {
- $params = array();
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new Google_SubscriptionsListResponse($data);
- } else {
- return $data;
- }
- }
- /**
- * Updates an existing subscription in place. (subscriptions.update)
- *
- * @param string $id The ID of the subscription.
- * @param Google_Subscription $postBody
- * @param array $optParams Optional parameters.
- * @return Google_Subscription
- */
- public function update($id, Google_Subscription $postBody, $optParams = array()) {
- $params = array('id' => $id, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('update', array($params));
- if ($this->useObjects()) {
- return new Google_Subscription($data);
- } else {
- return $data;
- }
- }
- }
- /google-api/src/contrib/Google_ResellerService.php
- class Google_SubscriptionsServiceResource extends Google_ServiceResource {
- /**
- * Changes the plan of a subscription (subscriptions.changePlan)
- *
- * @param string $customerId Id of the Customer
- * @param string $subscriptionId Id of the subscription, which is unique for a customer
- * @param Google_ChangePlanRequest $postBody
- * @param array $optParams Optional parameters.
- * @return Google_Subscription
- */
- public function changePlan($customerId, $subscriptionId, Google_ChangePlanRequest $postBody, $optParams = array()) {
- $params = array('customerId' => $customerId, 'subscriptionId' => $subscriptionId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('changePlan', array($params));
- if ($this->useObjects()) {
- return new Google_Subscription($data);
- } else {
- return $data;
- }
- }
- /**
- * Changes the renewal settings of a subscription (subscriptions.changeRenewalSettings)
- *
- * @param string $customerId Id of the Customer
- * @param string $subscriptionId Id of the subscription, which is unique for a customer
- * @param Google_RenewalSettings $postBody
- * @param array $optParams Optional parameters.
- * @return Google_Subscription
- */
- public function changeRenewalSettings($customerId, $subscriptionId, Google_RenewalSettings $postBody, $optParams = array()) {
- $params = array('customerId' => $customerId, 'subscriptionId' => $subscriptionId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('changeRenewalSettings', array($params));
- if ($this->useObjects()) {
- return new Google_Subscription($data);
- } else {
- return $data;
- }
- }
- /**
- * Changes the seats configuration of a subscription (subscriptions.changeSeats)
- *
- * @param string $customerId Id of the Customer
- * @param string $subscriptionId Id of the subscription, which is unique for a customer
- * @param Google_Seats $postBody
- * @param array $optParams Optional parameters.
- * @return Google_Subscription
- */
- public function changeSeats($customerId, $subscriptionId, Google_Seats $postBody, $optParams = array()) {
- $params = array('customerId' => $customerId, 'subscriptionId' => $subscriptionId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('changeSeats', array($params));
- if ($this->useObjects()) {
- return new Google_Subscription($data);
- } else {
- return $data;
- }
- }
- /**
- * Cancels/Downgrades a subscription. (subscriptions.delete)
- *
- * @param string $customerId Id of the Customer
- * @param string $subscriptionId Id of the subscription, which is unique for a customer
- * @param string $deletionType Whether the subscription is to be fully cancelled or downgraded
- * @param array $optParams Optional parameters.
- */
- public function delete($customerId, $subscriptionId, $deletionType, $optParams = array()) {
- $params = array('customerId' => $customerId, 'subscriptionId' => $subscriptionId, 'deletionType' => $deletionType);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- /**
- * Gets a subscription of the customer. (subscriptions.get)
- *
- * @param string $customerId Id of the Customer
- * @param string $subscriptionId Id of the subscription, which is unique for a customer
- * @param array $optParams Optional parameters.
- * @return Google_Subscription
- */
- public function get($customerId, $subscriptionId, $optParams = array()) {
- $params = array('customerId' => $customerId, 'subscriptionId' => $subscriptionId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('get', array($params));
- if ($this->useObjects()) {
- return new Google_Subscription($data);
- } else {
- return $data;
- }
- }
- /**
- * Creates/Transfers a subscription for the customer. (subscriptions.insert)
- *
- * @param string $customerId Id of the Customer
- * @param Google_Subscription $postBody
- * @param array $optParams Optional parameters.
- *
- * @opt_param string customerAuthToken An auth token needed for transferring a subscription. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken. Optional.
- * @return Google_Subscription
- */
- public function insert($customerId, Google_Subscription $postBody, $optParams = array()) {
- $params = array('customerId' => $customerId, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert', array($params));
- if ($this->useObjects()) {
- return new Google_Subscription($data);
- } else {
- return $data;
- }
- }
- /**
- * Lists subscriptions of a reseller, optionally filtered by a customer name prefix.
- * (subscriptions.list)
- *
- * @param array $optParams Optional parameters.
- *
- * @opt_param string pageToken Token to specify next page in the list
- * @opt_param string maxResults Maximum number of results to return
- * @opt_param string customerNamePrefix Prefix of the customer's domain name by which the subscriptions should be filtered. Optional
- * @return Google_Subscriptions
- */
- public function listSubscriptions($optParams = array()) {
- $params = array();
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new Google_Subscriptions($data);
- } else {
- return $data;
- }
- }
- /**
- * Starts paid service of a trial subscription (subscriptions.startPaidService)
- *
- * @param string $customerId Id of the Customer
- * @param string $subscriptionId Id of the subscription, which is unique for a customer
- * @param array $optParams Optional parameters.
- * @return Google_Subscription
- */
- public function startPaidService($customerId, $subscriptionId, $optParams = array()) {
- $params = array('customerId' => $customerId, 'subscriptionId' => $subscriptionId);
- $params = array_merge($params, $optParams);
- $data = $this->__call('startPaidService', array($params));
- if ($this->useObjects()) {
- return new Google_Subscription($data);
- } else {
- return $data;
- }
- }
- }
- /google-api/src/contrib/Google_YouTubeService.php
- class Google_SubscriptionsServiceResource extends Google_ServiceResource {
- /**
- * Deletes a subscription. (subscriptions.delete)
- *
- * @param string $id The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID.
- * @param array $optParams Optional parameters.
- */
- public function delete($id, $optParams = array()) {
- $params = array('id' => $id);
- $params = array_merge($params, $optParams);
- $data = $this->__call('delete', array($params));
- return $data;
- }
- /**
- * Adds a subscription for the authenticated user's channel. (subscriptions.insert)
- *
- * @param string $part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.
- The part names that you can include in the parameter value are snippet and contentDetails.
- * @param Google_Subscription $postBody
- * @param array $optParams Optional parameters.
- * @return Google_Subscription
- */
- public function insert($part, Google_Subscription $postBody, $optParams = array()) {
- $params = array('part' => $part, 'postBody' => $postBody);
- $params = array_merge($params, $optParams);
- $data = $this->__call('insert', array($params));
- if ($this->useObjects()) {
- return new Google_Subscription($data);
- } else {
- return $data;
- }
- }
- /**
- * Returns subscription resources that match the API request criteria. (subscriptions.list)
- *
- * @param string $part The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.
- If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties.
- * @param array $optParams Optional parameters.
- *
- * @opt_param string channelId The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions.
- * @opt_param string forChannelId The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.
- * @opt_param string id The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID.
- * @opt_param string maxResults USE_DESCRIPTION --- channels:list:maxResults
- * @opt_param bool mine Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions.
- * @opt_param string order The order parameter specifies the method that will be used to sort resources in the API response.
- * @opt_param string pageToken USE_DESCRIPTION --- channels:list:pageToken
- * @return Google_SubscriptionListResponse
- */
- public function listSubscriptions($part, $optParams = array()) {
- $params = array('part' => $part);
- $params = array_merge($params, $optParams);
- $data = $this->__call('list', array($params));
- if ($this->useObjects()) {
- return new Google_SubscriptionListResponse($data);
- } else {
- return $data;
- }
- }
- }