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\ActivateBuyOnGoogleProgramRequest; 21use Google\Service\ShoppingContent\BuyOnGoogleProgramStatus; 22use Google\Service\ShoppingContent\OnboardBuyOnGoogleProgramRequest; 23use Google\Service\ShoppingContent\PauseBuyOnGoogleProgramRequest; 24use Google\Service\ShoppingContent\RequestReviewBuyOnGoogleProgramRequest; 25 26/** 27 * The "buyongoogleprograms" collection of methods. 28 * Typical usage is: 29 * <code> 30 * $contentService = new Google\Service\ShoppingContent(...); 31 * $buyongoogleprograms = $contentService->buyongoogleprograms; 32 * </code> 33 */ 34class Buyongoogleprograms extends \Google\Service\Resource 35{ 36 /** 37 * Reactivates the BoG program in your Merchant Center account. Moves the 38 * program to the active state when allowed, for example, when paused. This 39 * method is only available to selected merchants. 40 * (buyongoogleprograms.activate) 41 * 42 * @param string $merchantId Required. The ID of the account. 43 * @param string $regionCode Required. The program region code [ISO 3166-1 44 * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US 45 * is available. 46 * @param ActivateBuyOnGoogleProgramRequest $postBody 47 * @param array $optParams Optional parameters. 48 */ 49 public function activate($merchantId, $regionCode, ActivateBuyOnGoogleProgramRequest $postBody, $optParams = []) 50 { 51 $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody]; 52 $params = array_merge($params, $optParams); 53 return $this->call('activate', [$params]); 54 } 55 /** 56 * Retrieves a status of the BoG program for your Merchant Center account. 57 * (buyongoogleprograms.get) 58 * 59 * @param string $merchantId Required. The ID of the account. 60 * @param string $regionCode Required. The Program region code [ISO 3166-1 61 * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US 62 * is available. 63 * @param array $optParams Optional parameters. 64 * @return BuyOnGoogleProgramStatus 65 */ 66 public function get($merchantId, $regionCode, $optParams = []) 67 { 68 $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode]; 69 $params = array_merge($params, $optParams); 70 return $this->call('get', [$params], BuyOnGoogleProgramStatus::class); 71 } 72 /** 73 * Onboards the BoG program in your Merchant Center account. By using this 74 * method, you agree to the [Terms of Service](https://merchants.google.com/mc/t 75 * ermsofservice/transactions/US/latest). Calling this method is only possible 76 * if the authenticated account is the same as the merchant id in the request. 77 * Calling this method multiple times will only accept Terms of Service if the 78 * latest version is not currently signed. (buyongoogleprograms.onboard) 79 * 80 * @param string $merchantId Required. The ID of the account. 81 * @param string $regionCode Required. The program region code [ISO 3166-1 82 * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US 83 * is available. 84 * @param OnboardBuyOnGoogleProgramRequest $postBody 85 * @param array $optParams Optional parameters. 86 */ 87 public function onboard($merchantId, $regionCode, OnboardBuyOnGoogleProgramRequest $postBody, $optParams = []) 88 { 89 $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody]; 90 $params = array_merge($params, $optParams); 91 return $this->call('onboard', [$params]); 92 } 93 /** 94 * Updates the status of the BoG program for your Merchant Center account. 95 * (buyongoogleprograms.patch) 96 * 97 * @param string $merchantId Required. The ID of the account. 98 * @param string $regionCode Required. The program region code [ISO 3166-1 99 * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US 100 * is available. 101 * @param BuyOnGoogleProgramStatus $postBody 102 * @param array $optParams Optional parameters. 103 * 104 * @opt_param string updateMask The list of fields to update. If the update mask 105 * is not provided, then all the fields set in buyOnGoogleProgramStatus will be 106 * updated. Clearing fields is only possible if update mask is provided. 107 * @return BuyOnGoogleProgramStatus 108 */ 109 public function patch($merchantId, $regionCode, BuyOnGoogleProgramStatus $postBody, $optParams = []) 110 { 111 $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody]; 112 $params = array_merge($params, $optParams); 113 return $this->call('patch', [$params], BuyOnGoogleProgramStatus::class); 114 } 115 /** 116 * Pauses the BoG program in your Merchant Center account. This method is only 117 * available to selected merchants. (buyongoogleprograms.pause) 118 * 119 * @param string $merchantId Required. The ID of the account. 120 * @param string $regionCode Required. The program region code [ISO 3166-1 121 * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US 122 * is available. 123 * @param PauseBuyOnGoogleProgramRequest $postBody 124 * @param array $optParams Optional parameters. 125 */ 126 public function pause($merchantId, $regionCode, PauseBuyOnGoogleProgramRequest $postBody, $optParams = []) 127 { 128 $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody]; 129 $params = array_merge($params, $optParams); 130 return $this->call('pause', [$params]); 131 } 132 /** 133 * Requests review and then activates the BoG program in your Merchant Center 134 * account for the first time. Moves the program to the REVIEW_PENDING state. 135 * This method is only available to selected merchants. 136 * (buyongoogleprograms.requestreview) 137 * 138 * @param string $merchantId Required. The ID of the account. 139 * @param string $regionCode Required. The program region code [ISO 3166-1 140 * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Currently only US 141 * is available. 142 * @param RequestReviewBuyOnGoogleProgramRequest $postBody 143 * @param array $optParams Optional parameters. 144 */ 145 public function requestreview($merchantId, $regionCode, RequestReviewBuyOnGoogleProgramRequest $postBody, $optParams = []) 146 { 147 $params = ['merchantId' => $merchantId, 'regionCode' => $regionCode, 'postBody' => $postBody]; 148 $params = array_merge($params, $optParams); 149 return $this->call('requestreview', [$params]); 150 } 151} 152 153// Adding a class alias for backwards compatibility with the previous class name. 154class_alias(Buyongoogleprograms::class, 'Google_Service_ShoppingContent_Resource_Buyongoogleprograms'); 155