* $contentService = new Google\Service\ShoppingContent(...); * $promotions = $contentService->promotions; * */ class Promotions extends \Google\Service\Resource { /** * Inserts a promotion for your Merchant Center account. If the promotion * already exists, then it will update the promotion instead. * (promotions.create) * * @param string $merchantId Required. The ID of the account that contains the * collection. * @param Promotion $postBody * @param array $optParams Optional parameters. * @return Promotion */ public function create($merchantId, Promotion $postBody, $optParams = []) { $params = ['merchantId' => $merchantId, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('create', [$params], Promotion::class); } /** * Retrieves a promotion from your Merchant Center account. (promotions.get) * * @param string $merchantId Required. The ID of the account that contains the * collection. * @param string $id Required. REST ID of the promotion to retrieve. * @param array $optParams Optional parameters. * @return Promotion */ public function get($merchantId, $id, $optParams = []) { $params = ['merchantId' => $merchantId, 'id' => $id]; $params = array_merge($params, $optParams); return $this->call('get', [$params], Promotion::class); } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(Promotions::class, 'Google_Service_ShoppingContent_Resource_Promotions');