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