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