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 18namespace Google\Service\ShoppingContent\Resource; 19 20use Google\Service\ShoppingContent\MerchantOrderReturn; 21use Google\Service\ShoppingContent\OrderreturnsAcknowledgeRequest; 22use Google\Service\ShoppingContent\OrderreturnsAcknowledgeResponse; 23use Google\Service\ShoppingContent\OrderreturnsCreateOrderReturnRequest; 24use Google\Service\ShoppingContent\OrderreturnsCreateOrderReturnResponse; 25use Google\Service\ShoppingContent\OrderreturnsListResponse; 26use Google\Service\ShoppingContent\OrderreturnsProcessRequest; 27use Google\Service\ShoppingContent\OrderreturnsProcessResponse; 28 29/** 30 * The "orderreturns" collection of methods. 31 * Typical usage is: 32 * <code> 33 * $contentService = new Google\Service\ShoppingContent(...); 34 * $orderreturns = $contentService->orderreturns; 35 * </code> 36 */ 37class Orderreturns extends \Google\Service\Resource 38{ 39 /** 40 * Acks an order return in your Merchant Center account. 41 * (orderreturns.acknowledge) 42 * 43 * @param string $merchantId The ID of the account that manages the order. This 44 * cannot be a multi-client account. 45 * @param string $returnId The ID of the return. 46 * @param OrderreturnsAcknowledgeRequest $postBody 47 * @param array $optParams Optional parameters. 48 * @return OrderreturnsAcknowledgeResponse 49 */ 50 public function acknowledge($merchantId, $returnId, OrderreturnsAcknowledgeRequest $postBody, $optParams = []) 51 { 52 $params = ['merchantId' => $merchantId, 'returnId' => $returnId, 'postBody' => $postBody]; 53 $params = array_merge($params, $optParams); 54 return $this->call('acknowledge', [$params], OrderreturnsAcknowledgeResponse::class); 55 } 56 /** 57 * Create return in your Merchant Center account. 58 * (orderreturns.createorderreturn) 59 * 60 * @param string $merchantId The ID of the account that manages the order. This 61 * cannot be a multi-client account. 62 * @param OrderreturnsCreateOrderReturnRequest $postBody 63 * @param array $optParams Optional parameters. 64 * @return OrderreturnsCreateOrderReturnResponse 65 */ 66 public function createorderreturn($merchantId, OrderreturnsCreateOrderReturnRequest $postBody, $optParams = []) 67 { 68 $params = ['merchantId' => $merchantId, 'postBody' => $postBody]; 69 $params = array_merge($params, $optParams); 70 return $this->call('createorderreturn', [$params], OrderreturnsCreateOrderReturnResponse::class); 71 } 72 /** 73 * Retrieves an order return from your Merchant Center account. 74 * (orderreturns.get) 75 * 76 * @param string $merchantId The ID of the account that manages the order. This 77 * cannot be a multi-client account. 78 * @param string $returnId Merchant order return ID generated by Google. 79 * @param array $optParams Optional parameters. 80 * @return MerchantOrderReturn 81 */ 82 public function get($merchantId, $returnId, $optParams = []) 83 { 84 $params = ['merchantId' => $merchantId, 'returnId' => $returnId]; 85 $params = array_merge($params, $optParams); 86 return $this->call('get', [$params], MerchantOrderReturn::class); 87 } 88 /** 89 * Lists order returns in your Merchant Center account. 90 * (orderreturns.listOrderreturns) 91 * 92 * @param string $merchantId The ID of the account that manages the order. This 93 * cannot be a multi-client account. 94 * @param array $optParams Optional parameters. 95 * 96 * @opt_param bool acknowledged Obtains order returns that match the 97 * acknowledgement status. When set to true, obtains order returns that have 98 * been acknowledged. When false, obtains order returns that have not been 99 * acknowledged. When not provided, obtains order returns regardless of their 100 * acknowledgement status. We recommend using this filter set to `false`, in 101 * conjunction with the `acknowledge` call, such that only un-acknowledged order 102 * returns are returned. 103 * @opt_param string createdEndDate Obtains order returns created before this 104 * date (inclusively), in ISO 8601 format. 105 * @opt_param string createdStartDate Obtains order returns created after this 106 * date (inclusively), in ISO 8601 format. 107 * @opt_param string googleOrderIds Obtains order returns with the specified 108 * order ids. If this parameter is provided, createdStartDate, createdEndDate, 109 * shipmentType, shipmentStatus, shipmentState and acknowledged parameters must 110 * be not set. Note: if googleOrderId and shipmentTrackingNumber parameters are 111 * provided, the obtained results will include all order returns that either 112 * match the specified order id or the specified tracking number. 113 * @opt_param string maxResults The maximum number of order returns to return in 114 * the response, used for paging. The default value is 25 returns per page, and 115 * the maximum allowed value is 250 returns per page. 116 * @opt_param string orderBy Return the results in the specified order. 117 * @opt_param string pageToken The token returned by the previous request. 118 * @opt_param string shipmentStates Obtains order returns that match any 119 * shipment state provided in this parameter. When this parameter is not 120 * provided, order returns are obtained regardless of their shipment states. 121 * @opt_param string shipmentStatus Obtains order returns that match any 122 * shipment status provided in this parameter. When this parameter is not 123 * provided, order returns are obtained regardless of their shipment statuses. 124 * @opt_param string shipmentTrackingNumbers Obtains order returns with the 125 * specified tracking numbers. If this parameter is provided, createdStartDate, 126 * createdEndDate, shipmentType, shipmentStatus, shipmentState and acknowledged 127 * parameters must be not set. Note: if googleOrderId and shipmentTrackingNumber 128 * parameters are provided, the obtained results will include all order returns 129 * that either match the specified order id or the specified tracking number. 130 * @opt_param string shipmentTypes Obtains order returns that match any shipment 131 * type provided in this parameter. When this parameter is not provided, order 132 * returns are obtained regardless of their shipment types. 133 * @return OrderreturnsListResponse 134 */ 135 public function listOrderreturns($merchantId, $optParams = []) 136 { 137 $params = ['merchantId' => $merchantId]; 138 $params = array_merge($params, $optParams); 139 return $this->call('list', [$params], OrderreturnsListResponse::class); 140 } 141 /** 142 * Processes return in your Merchant Center account. (orderreturns.process) 143 * 144 * @param string $merchantId The ID of the account that manages the order. This 145 * cannot be a multi-client account. 146 * @param string $returnId The ID of the return. 147 * @param OrderreturnsProcessRequest $postBody 148 * @param array $optParams Optional parameters. 149 * @return OrderreturnsProcessResponse 150 */ 151 public function process($merchantId, $returnId, OrderreturnsProcessRequest $postBody, $optParams = []) 152 { 153 $params = ['merchantId' => $merchantId, 'returnId' => $returnId, 'postBody' => $postBody]; 154 $params = array_merge($params, $optParams); 155 return $this->call('process', [$params], OrderreturnsProcessResponse::class); 156 } 157} 158 159// Adding a class alias for backwards compatibility with the previous class name. 160class_alias(Orderreturns::class, 'Google_Service_ShoppingContent_Resource_Orderreturns'); 161