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\SearchListResponse;
21
22/**
23 * The "search" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $youtubeService = new Google\Service\YouTube(...);
27 *   $search = $youtubeService->search;
28 *  </code>
29 */
30class Search extends \Google\Service\Resource
31{
32  /**
33   * Retrieves a list of search resources (search.listSearch)
34   *
35   * @param string|array $part The *part* parameter specifies a comma-separated
36   * list of one or more search resource properties that the API response will
37   * include. Set the parameter value to snippet.
38   * @param array $optParams Optional parameters.
39   *
40   * @opt_param string channelId Filter on resources belonging to this channelId.
41   * @opt_param string channelType Add a filter on the channel search.
42   * @opt_param string eventType Filter on the livestream status of the videos.
43   * @opt_param bool forContentOwner Search owned by a content owner.
44   * @opt_param bool forDeveloper Restrict the search to only retrieve videos
45   * uploaded using the project id of the authenticated user.
46   * @opt_param bool forMine Search for the private videos of the authenticated
47   * user.
48   * @opt_param string location Filter on location of the video
49   * @opt_param string locationRadius Filter on distance from the location
50   * (specified above).
51   * @opt_param string maxResults The *maxResults* parameter specifies the maximum
52   * number of items that should be returned in the result set.
53   * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
54   * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
55   * parameter indicates that the request's authorization credentials identify a
56   * YouTube CMS user who is acting on behalf of the content owner specified in
57   * the parameter value. This parameter is intended for YouTube content partners
58   * that own and manage many different YouTube channels. It allows content owners
59   * to authenticate once and get access to all their video and channel data,
60   * without having to provide authentication credentials for each individual
61   * channel. The CMS account that the user authenticates with must be linked to
62   * the specified YouTube content owner.
63   * @opt_param string order Sort order of the results.
64   * @opt_param string pageToken The *pageToken* parameter identifies a specific
65   * page in the result set that should be returned. In an API response, the
66   * nextPageToken and prevPageToken properties identify other pages that could be
67   * retrieved.
68   * @opt_param string publishedAfter Filter on resources published after this
69   * date.
70   * @opt_param string publishedBefore Filter on resources published before this
71   * date.
72   * @opt_param string q Textual search terms to match.
73   * @opt_param string regionCode Display the content as seen by viewers in this
74   * country.
75   * @opt_param string relatedToVideoId Search related to a resource.
76   * @opt_param string relevanceLanguage Return results relevant to this language.
77   * @opt_param string safeSearch Indicates whether the search results should
78   * include restricted content as well as standard content.
79   * @opt_param string topicId Restrict results to a particular topic.
80   * @opt_param string type Restrict results to a particular set of resource types
81   * from One Platform.
82   * @opt_param string videoCaption Filter on the presence of captions on the
83   * videos.
84   * @opt_param string videoCategoryId Filter on videos in a specific category.
85   * @opt_param string videoDefinition Filter on the definition of the videos.
86   * @opt_param string videoDimension Filter on 3d videos.
87   * @opt_param string videoDuration Filter on the duration of the videos.
88   * @opt_param string videoEmbeddable Filter on embeddable videos.
89   * @opt_param string videoLicense Filter on the license of the videos.
90   * @opt_param string videoSyndicated Filter on syndicated videos.
91   * @opt_param string videoType Filter on videos of a specific type.
92   * @return SearchListResponse
93   */
94  public function listSearch($part, $optParams = [])
95  {
96    $params = ['part' => $part];
97    $params = array_merge($params, $optParams);
98    return $this->call('list', [$params], SearchListResponse::class);
99  }
100}
101
102// Adding a class alias for backwards compatibility with the previous class name.
103class_alias(Search::class, 'Google_Service_YouTube_Resource_Search');
104