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\CloudTalentSolution\Resource; 19 20use Google\Service\CloudTalentSolution\CompleteQueryResponse; 21use Google\Service\CloudTalentSolution\JobsEmpty; 22use Google\Service\CloudTalentSolution\ListTenantsResponse; 23use Google\Service\CloudTalentSolution\Tenant; 24 25/** 26 * The "tenants" collection of methods. 27 * Typical usage is: 28 * <code> 29 * $jobsService = new Google\Service\CloudTalentSolution(...); 30 * $tenants = $jobsService->tenants; 31 * </code> 32 */ 33class ProjectsTenants extends \Google\Service\Resource 34{ 35 /** 36 * Completes the specified prefix with keyword suggestions. Intended for use by 37 * a job search auto-complete search box. (tenants.completeQuery) 38 * 39 * @param string $tenant Required. Resource name of tenant the completion is 40 * performed within. The format is "projects/{project_id}/tenants/{tenant_id}", 41 * for example, "projects/foo/tenants/bar". 42 * @param array $optParams Optional parameters. 43 * 44 * @opt_param string company If provided, restricts completion to specified 45 * company. The format is 46 * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for 47 * example, "projects/foo/tenants/bar/companies/baz". 48 * @opt_param string languageCodes The list of languages of the query. This is 49 * the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, 50 * see [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). The 51 * maximum number of allowed characters is 255. 52 * @opt_param int pageSize Required. Completion result count. The maximum 53 * allowed page size is 10. 54 * @opt_param string query Required. The query used to generate suggestions. The 55 * maximum number of allowed characters is 255. 56 * @opt_param string scope The scope of the completion. The defaults is 57 * CompletionScope.PUBLIC. 58 * @opt_param string type The completion topic. The default is 59 * CompletionType.COMBINED. 60 * @return CompleteQueryResponse 61 */ 62 public function completeQuery($tenant, $optParams = []) 63 { 64 $params = ['tenant' => $tenant]; 65 $params = array_merge($params, $optParams); 66 return $this->call('completeQuery', [$params], CompleteQueryResponse::class); 67 } 68 /** 69 * Creates a new tenant entity. (tenants.create) 70 * 71 * @param string $parent Required. Resource name of the project under which the 72 * tenant is created. The format is "projects/{project_id}", for example, 73 * "projects/foo". 74 * @param Tenant $postBody 75 * @param array $optParams Optional parameters. 76 * @return Tenant 77 */ 78 public function create($parent, Tenant $postBody, $optParams = []) 79 { 80 $params = ['parent' => $parent, 'postBody' => $postBody]; 81 $params = array_merge($params, $optParams); 82 return $this->call('create', [$params], Tenant::class); 83 } 84 /** 85 * Deletes specified tenant. (tenants.delete) 86 * 87 * @param string $name Required. The resource name of the tenant to be deleted. 88 * The format is "projects/{project_id}/tenants/{tenant_id}", for example, 89 * "projects/foo/tenants/bar". 90 * @param array $optParams Optional parameters. 91 * @return JobsEmpty 92 */ 93 public function delete($name, $optParams = []) 94 { 95 $params = ['name' => $name]; 96 $params = array_merge($params, $optParams); 97 return $this->call('delete', [$params], JobsEmpty::class); 98 } 99 /** 100 * Retrieves specified tenant. (tenants.get) 101 * 102 * @param string $name Required. The resource name of the tenant to be 103 * retrieved. The format is "projects/{project_id}/tenants/{tenant_id}", for 104 * example, "projects/foo/tenants/bar". 105 * @param array $optParams Optional parameters. 106 * @return Tenant 107 */ 108 public function get($name, $optParams = []) 109 { 110 $params = ['name' => $name]; 111 $params = array_merge($params, $optParams); 112 return $this->call('get', [$params], Tenant::class); 113 } 114 /** 115 * Lists all tenants associated with the project. (tenants.listProjectsTenants) 116 * 117 * @param string $parent Required. Resource name of the project under which the 118 * tenant is created. The format is "projects/{project_id}", for example, 119 * "projects/foo". 120 * @param array $optParams Optional parameters. 121 * 122 * @opt_param int pageSize The maximum number of tenants to be returned, at most 123 * 100. Default is 100 if a non-positive number is provided. 124 * @opt_param string pageToken The starting indicator from which to return 125 * results. 126 * @return ListTenantsResponse 127 */ 128 public function listProjectsTenants($parent, $optParams = []) 129 { 130 $params = ['parent' => $parent]; 131 $params = array_merge($params, $optParams); 132 return $this->call('list', [$params], ListTenantsResponse::class); 133 } 134 /** 135 * Updates specified tenant. (tenants.patch) 136 * 137 * @param string $name Required during tenant update. The resource name for a 138 * tenant. This is generated by the service when a tenant is created. The format 139 * is "projects/{project_id}/tenants/{tenant_id}", for example, 140 * "projects/foo/tenants/bar". 141 * @param Tenant $postBody 142 * @param array $optParams Optional parameters. 143 * 144 * @opt_param string updateMask Strongly recommended for the best service 145 * experience. If update_mask is provided, only the specified fields in tenant 146 * are updated. Otherwise all the fields are updated. A field mask to specify 147 * the tenant fields to be updated. Only top level fields of Tenant are 148 * supported. 149 * @return Tenant 150 */ 151 public function patch($name, Tenant $postBody, $optParams = []) 152 { 153 $params = ['name' => $name, 'postBody' => $postBody]; 154 $params = array_merge($params, $optParams); 155 return $this->call('patch', [$params], Tenant::class); 156 } 157} 158 159// Adding a class alias for backwards compatibility with the previous class name. 160class_alias(ProjectsTenants::class, 'Google_Service_CloudTalentSolution_Resource_ProjectsTenants'); 161