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\Dfareporting\Resource; 19 20use Google\Service\Dfareporting\Project; 21use Google\Service\Dfareporting\ProjectsListResponse; 22 23/** 24 * The "projects" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $dfareportingService = new Google\Service\Dfareporting(...); 28 * $projects = $dfareportingService->projects; 29 * </code> 30 */ 31class Projects extends \Google\Service\Resource 32{ 33 /** 34 * Gets one project by ID. (projects.get) 35 * 36 * @param string $profileId User profile ID associated with this request. 37 * @param string $id Project ID. 38 * @param array $optParams Optional parameters. 39 * @return Project 40 */ 41 public function get($profileId, $id, $optParams = []) 42 { 43 $params = ['profileId' => $profileId, 'id' => $id]; 44 $params = array_merge($params, $optParams); 45 return $this->call('get', [$params], Project::class); 46 } 47 /** 48 * Retrieves a list of projects, possibly filtered. This method supports paging 49 * . (projects.listProjects) 50 * 51 * @param string $profileId User profile ID associated with this request. 52 * @param array $optParams Optional parameters. 53 * 54 * @opt_param string advertiserIds Select only projects with these advertiser 55 * IDs. 56 * @opt_param string ids Select only projects with these IDs. 57 * @opt_param int maxResults Maximum number of results to return. 58 * @opt_param string pageToken Value of the nextPageToken from the previous 59 * result page. 60 * @opt_param string searchString Allows searching for projects by name or ID. 61 * Wildcards (*) are allowed. For example, "project*2015" will return projects 62 * with names like "project June 2015", "project April 2015", or simply "project 63 * 2015". Most of the searches also add wildcards implicitly at the start and 64 * the end of the search string. For example, a search string of "project" will 65 * match projects with name "my project", "project 2015", or simply "project". 66 * @opt_param string sortField Field by which to sort the list. 67 * @opt_param string sortOrder Order of sorted results. 68 * @return ProjectsListResponse 69 */ 70 public function listProjects($profileId, $optParams = []) 71 { 72 $params = ['profileId' => $profileId]; 73 $params = array_merge($params, $optParams); 74 return $this->call('list', [$params], ProjectsListResponse::class); 75 } 76} 77 78// Adding a class alias for backwards compatibility with the previous class name. 79class_alias(Projects::class, 'Google_Service_Dfareporting_Resource_Projects'); 80