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\YouTube\Resource; 19 20use Google\Service\YouTube\ThirdPartyLink; 21 22/** 23 * The "thirdPartyLinks" collection of methods. 24 * Typical usage is: 25 * <code> 26 * $youtubeService = new Google\Service\YouTube(...); 27 * $thirdPartyLinks = $youtubeService->thirdPartyLinks; 28 * </code> 29 */ 30class ThirdPartyLinks extends \Google\Service\Resource 31{ 32 /** 33 * Deletes a resource. (thirdPartyLinks.delete) 34 * 35 * @param string $linkingToken Delete the partner links with the given linking 36 * token. 37 * @param string $type Type of the link to be deleted. 38 * @param array $optParams Optional parameters. 39 * 40 * @opt_param string externalChannelId Channel ID to which changes should be 41 * applied, for delegation. 42 * @opt_param string part Do not use. Required for compatibility. 43 */ 44 public function delete($linkingToken, $type, $optParams = []) 45 { 46 $params = ['linkingToken' => $linkingToken, 'type' => $type]; 47 $params = array_merge($params, $optParams); 48 return $this->call('delete', [$params]); 49 } 50 /** 51 * Inserts a new resource into this collection. (thirdPartyLinks.insert) 52 * 53 * @param string|array $part The *part* parameter specifies the thirdPartyLink 54 * resource parts that the API request and response will include. Supported 55 * values are linkingToken, status, and snippet. 56 * @param ThirdPartyLink $postBody 57 * @param array $optParams Optional parameters. 58 * 59 * @opt_param string externalChannelId Channel ID to which changes should be 60 * applied, for delegation. 61 * @return ThirdPartyLink 62 */ 63 public function insert($part, ThirdPartyLink $postBody, $optParams = []) 64 { 65 $params = ['part' => $part, 'postBody' => $postBody]; 66 $params = array_merge($params, $optParams); 67 return $this->call('insert', [$params], ThirdPartyLink::class); 68 } 69 /** 70 * Retrieves a list of resources, possibly filtered. 71 * (thirdPartyLinks.listThirdPartyLinks) 72 * 73 * @param string|array $part The *part* parameter specifies the thirdPartyLink 74 * resource parts that the API response will include. Supported values are 75 * linkingToken, status, and snippet. 76 * @param array $optParams Optional parameters. 77 * 78 * @opt_param string externalChannelId Channel ID to which changes should be 79 * applied, for delegation. 80 * @opt_param string linkingToken Get a third party link with the given linking 81 * token. 82 * @opt_param string type Get a third party link of the given type. 83 * @return ThirdPartyLink 84 */ 85 public function listThirdPartyLinks($part, $optParams = []) 86 { 87 $params = ['part' => $part]; 88 $params = array_merge($params, $optParams); 89 return $this->call('list', [$params], ThirdPartyLink::class); 90 } 91 /** 92 * Updates an existing resource. (thirdPartyLinks.update) 93 * 94 * @param string|array $part The *part* parameter specifies the thirdPartyLink 95 * resource parts that the API request and response will include. Supported 96 * values are linkingToken, status, and snippet. 97 * @param ThirdPartyLink $postBody 98 * @param array $optParams Optional parameters. 99 * 100 * @opt_param string externalChannelId Channel ID to which changes should be 101 * applied, for delegation. 102 * @return ThirdPartyLink 103 */ 104 public function update($part, ThirdPartyLink $postBody, $optParams = []) 105 { 106 $params = ['part' => $part, 'postBody' => $postBody]; 107 $params = array_merge($params, $optParams); 108 return $this->call('update', [$params], ThirdPartyLink::class); 109 } 110} 111 112// Adding a class alias for backwards compatibility with the previous class name. 113class_alias(ThirdPartyLinks::class, 'Google_Service_YouTube_Resource_ThirdPartyLinks'); 114