[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\Walletobjects\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Walletobjects\AddMessageRequest;
|
---|
| 21 | use Google\Service\Walletobjects\OfferClass as OfferClassModel;
|
---|
| 22 | use Google\Service\Walletobjects\OfferClassAddMessageResponse;
|
---|
| 23 | use Google\Service\Walletobjects\OfferClassListResponse;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "offerclass" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $walletobjectsService = new Google\Service\Walletobjects(...);
|
---|
| 30 | * $offerclass = $walletobjectsService->offerclass;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class Offerclass extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Adds a message to the offer class referenced by the given class ID.
|
---|
| 37 | * (offerclass.addmessage)
|
---|
| 38 | *
|
---|
| 39 | * @param string $resourceId The unique identifier for a class. This ID must be
|
---|
| 40 | * unique across all classes from an issuer. This value should follow the format
|
---|
| 41 | * issuer ID. identifier where the former is issued by Google and latter is
|
---|
| 42 | * chosen by you. Your unique identifier should only include alphanumeric
|
---|
| 43 | * characters, '.', '_', or '-'.
|
---|
| 44 | * @param AddMessageRequest $postBody
|
---|
| 45 | * @param array $optParams Optional parameters.
|
---|
| 46 | * @return OfferClassAddMessageResponse
|
---|
| 47 | * @throws \Google\Service\Exception
|
---|
| 48 | */
|
---|
| 49 | public function addmessage($resourceId, AddMessageRequest $postBody, $optParams = [])
|
---|
| 50 | {
|
---|
| 51 | $params = ['resourceId' => $resourceId, 'postBody' => $postBody];
|
---|
| 52 | $params = array_merge($params, $optParams);
|
---|
| 53 | return $this->call('addmessage', [$params], OfferClassAddMessageResponse::class);
|
---|
| 54 | }
|
---|
| 55 | /**
|
---|
| 56 | * Returns the offer class with the given class ID. (offerclass.get)
|
---|
| 57 | *
|
---|
| 58 | * @param string $resourceId The unique identifier for a class. This ID must be
|
---|
| 59 | * unique across all classes from an issuer. This value should follow the format
|
---|
| 60 | * issuer ID. identifier where the former is issued by Google and latter is
|
---|
| 61 | * chosen by you. Your unique identifier should only include alphanumeric
|
---|
| 62 | * characters, '.', '_', or '-'.
|
---|
| 63 | * @param array $optParams Optional parameters.
|
---|
| 64 | * @return OfferClassModel
|
---|
| 65 | * @throws \Google\Service\Exception
|
---|
| 66 | */
|
---|
| 67 | public function get($resourceId, $optParams = [])
|
---|
| 68 | {
|
---|
| 69 | $params = ['resourceId' => $resourceId];
|
---|
| 70 | $params = array_merge($params, $optParams);
|
---|
| 71 | return $this->call('get', [$params], OfferClassModel::class);
|
---|
| 72 | }
|
---|
| 73 | /**
|
---|
| 74 | * Inserts an offer class with the given ID and properties. (offerclass.insert)
|
---|
| 75 | *
|
---|
| 76 | * @param OfferClassModel $postBody
|
---|
| 77 | * @param array $optParams Optional parameters.
|
---|
| 78 | * @return OfferClassModel
|
---|
| 79 | * @throws \Google\Service\Exception
|
---|
| 80 | */
|
---|
| 81 | public function insert(OfferClassModel $postBody, $optParams = [])
|
---|
| 82 | {
|
---|
| 83 | $params = ['postBody' => $postBody];
|
---|
| 84 | $params = array_merge($params, $optParams);
|
---|
| 85 | return $this->call('insert', [$params], OfferClassModel::class);
|
---|
| 86 | }
|
---|
| 87 | /**
|
---|
| 88 | * Returns a list of all offer classes for a given issuer ID.
|
---|
| 89 | * (offerclass.listOfferclass)
|
---|
| 90 | *
|
---|
| 91 | * @param array $optParams Optional parameters.
|
---|
| 92 | *
|
---|
| 93 | * @opt_param string issuerId The ID of the issuer authorized to list classes.
|
---|
| 94 | * @opt_param int maxResults Identifies the max number of results returned by a
|
---|
| 95 | * list. All results are returned if `maxResults` isn't defined.
|
---|
| 96 | * @opt_param string token Used to get the next set of results if `maxResults`
|
---|
| 97 | * is specified, but more than `maxResults` classes are available in a list. For
|
---|
| 98 | * example, if you have a list of 200 classes and you call list with
|
---|
| 99 | * `maxResults` set to 20, list will return the first 20 classes and a token.
|
---|
| 100 | * Call list again with `maxResults` set to 20 and the token to get the next 20
|
---|
| 101 | * classes.
|
---|
| 102 | * @return OfferClassListResponse
|
---|
| 103 | * @throws \Google\Service\Exception
|
---|
| 104 | */
|
---|
| 105 | public function listOfferclass($optParams = [])
|
---|
| 106 | {
|
---|
| 107 | $params = [];
|
---|
| 108 | $params = array_merge($params, $optParams);
|
---|
| 109 | return $this->call('list', [$params], OfferClassListResponse::class);
|
---|
| 110 | }
|
---|
| 111 | /**
|
---|
| 112 | * Updates the offer class referenced by the given class ID. This method
|
---|
| 113 | * supports patch semantics. (offerclass.patch)
|
---|
| 114 | *
|
---|
| 115 | * @param string $resourceId The unique identifier for a class. This ID must be
|
---|
| 116 | * unique across all classes from an issuer. This value should follow the format
|
---|
| 117 | * issuer ID. identifier where the former is issued by Google and latter is
|
---|
| 118 | * chosen by you. Your unique identifier should only include alphanumeric
|
---|
| 119 | * characters, '.', '_', or '-'.
|
---|
| 120 | * @param OfferClassModel $postBody
|
---|
| 121 | * @param array $optParams Optional parameters.
|
---|
| 122 | * @return OfferClassModel
|
---|
| 123 | * @throws \Google\Service\Exception
|
---|
| 124 | */
|
---|
| 125 | public function patch($resourceId, OfferClassModel $postBody, $optParams = [])
|
---|
| 126 | {
|
---|
| 127 | $params = ['resourceId' => $resourceId, 'postBody' => $postBody];
|
---|
| 128 | $params = array_merge($params, $optParams);
|
---|
| 129 | return $this->call('patch', [$params], OfferClassModel::class);
|
---|
| 130 | }
|
---|
| 131 | /**
|
---|
| 132 | * Updates the offer class referenced by the given class ID. (offerclass.update)
|
---|
| 133 | *
|
---|
| 134 | * @param string $resourceId The unique identifier for a class. This ID must be
|
---|
| 135 | * unique across all classes from an issuer. This value should follow the format
|
---|
| 136 | * issuer ID. identifier where the former is issued by Google and latter is
|
---|
| 137 | * chosen by you. Your unique identifier should only include alphanumeric
|
---|
| 138 | * characters, '.', '_', or '-'.
|
---|
| 139 | * @param OfferClassModel $postBody
|
---|
| 140 | * @param array $optParams Optional parameters.
|
---|
| 141 | * @return OfferClassModel
|
---|
| 142 | * @throws \Google\Service\Exception
|
---|
| 143 | */
|
---|
| 144 | public function update($resourceId, OfferClassModel $postBody, $optParams = [])
|
---|
| 145 | {
|
---|
| 146 | $params = ['resourceId' => $resourceId, 'postBody' => $postBody];
|
---|
| 147 | $params = array_merge($params, $optParams);
|
---|
| 148 | return $this->call('update', [$params], OfferClassModel::class);
|
---|
| 149 | }
|
---|
| 150 | }
|
---|
| 151 |
|
---|
| 152 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 153 | class_alias(Offerclass::class, 'Google_Service_Walletobjects_Resource_Offerclass');
|
---|