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\CloudTalentSolution\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\CloudTalentSolution\Company;
|
---|
21 | use Google\Service\CloudTalentSolution\JobsEmpty;
|
---|
22 | use Google\Service\CloudTalentSolution\ListCompaniesResponse;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "companies" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $jobsService = new Google\Service\CloudTalentSolution(...);
|
---|
29 | * $companies = $jobsService->projects_tenants_companies;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsTenantsCompanies extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a new company entity. (companies.create)
|
---|
36 | *
|
---|
37 | * @param string $parent Required. Resource name of the tenant under which the
|
---|
38 | * company is created. The format is
|
---|
39 | * "projects/{project_id}/tenants/{tenant_id}", for example,
|
---|
40 | * "projects/foo/tenants/bar".
|
---|
41 | * @param Company $postBody
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | * @return Company
|
---|
44 | * @throws \Google\Service\Exception
|
---|
45 | */
|
---|
46 | public function create($parent, Company $postBody, $optParams = [])
|
---|
47 | {
|
---|
48 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
49 | $params = array_merge($params, $optParams);
|
---|
50 | return $this->call('create', [$params], Company::class);
|
---|
51 | }
|
---|
52 | /**
|
---|
53 | * Deletes specified company. Prerequisite: The company has no jobs associated
|
---|
54 | * with it. (companies.delete)
|
---|
55 | *
|
---|
56 | * @param string $name Required. The resource name of the company to be deleted.
|
---|
57 | * The format is
|
---|
58 | * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
|
---|
59 | * example, "projects/foo/tenants/bar/companies/baz".
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return JobsEmpty
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function delete($name, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['name' => $name];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('delete', [$params], JobsEmpty::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Retrieves specified company. (companies.get)
|
---|
72 | *
|
---|
73 | * @param string $name Required. The resource name of the company to be
|
---|
74 | * retrieved. The format is
|
---|
75 | * "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
|
---|
76 | * example, "projects/api-test-project/tenants/foo/companies/bar".
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | * @return Company
|
---|
79 | * @throws \Google\Service\Exception
|
---|
80 | */
|
---|
81 | public function get($name, $optParams = [])
|
---|
82 | {
|
---|
83 | $params = ['name' => $name];
|
---|
84 | $params = array_merge($params, $optParams);
|
---|
85 | return $this->call('get', [$params], Company::class);
|
---|
86 | }
|
---|
87 | /**
|
---|
88 | * Lists all companies associated with the project.
|
---|
89 | * (companies.listProjectsTenantsCompanies)
|
---|
90 | *
|
---|
91 | * @param string $parent Required. Resource name of the tenant under which the
|
---|
92 | * company is created. The format is
|
---|
93 | * "projects/{project_id}/tenants/{tenant_id}", for example,
|
---|
94 | * "projects/foo/tenants/bar".
|
---|
95 | * @param array $optParams Optional parameters.
|
---|
96 | *
|
---|
97 | * @opt_param int pageSize The maximum number of companies to be returned, at
|
---|
98 | * most 100. Default is 100 if a non-positive number is provided.
|
---|
99 | * @opt_param string pageToken The starting indicator from which to return
|
---|
100 | * results.
|
---|
101 | * @opt_param bool requireOpenJobs Set to true if the companies requested must
|
---|
102 | * have open jobs. Defaults to false. If true, at most page_size of companies
|
---|
103 | * are fetched, among which only those with open jobs are returned.
|
---|
104 | * @return ListCompaniesResponse
|
---|
105 | * @throws \Google\Service\Exception
|
---|
106 | */
|
---|
107 | public function listProjectsTenantsCompanies($parent, $optParams = [])
|
---|
108 | {
|
---|
109 | $params = ['parent' => $parent];
|
---|
110 | $params = array_merge($params, $optParams);
|
---|
111 | return $this->call('list', [$params], ListCompaniesResponse::class);
|
---|
112 | }
|
---|
113 | /**
|
---|
114 | * Updates specified company. (companies.patch)
|
---|
115 | *
|
---|
116 | * @param string $name Required during company update. The resource name for a
|
---|
117 | * company. This is generated by the service when a company is created. The
|
---|
118 | * format is "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}",
|
---|
119 | * for example, "projects/foo/tenants/bar/companies/baz".
|
---|
120 | * @param Company $postBody
|
---|
121 | * @param array $optParams Optional parameters.
|
---|
122 | *
|
---|
123 | * @opt_param string updateMask Strongly recommended for the best service
|
---|
124 | * experience. If update_mask is provided, only the specified fields in company
|
---|
125 | * are updated. Otherwise all the fields are updated. A field mask to specify
|
---|
126 | * the company fields to be updated. Only top level fields of Company are
|
---|
127 | * supported.
|
---|
128 | * @return Company
|
---|
129 | * @throws \Google\Service\Exception
|
---|
130 | */
|
---|
131 | public function patch($name, Company $postBody, $optParams = [])
|
---|
132 | {
|
---|
133 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
134 | $params = array_merge($params, $optParams);
|
---|
135 | return $this->call('patch', [$params], Company::class);
|
---|
136 | }
|
---|
137 | }
|
---|
138 |
|
---|
139 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
140 | class_alias(ProjectsTenantsCompanies::class, 'Google_Service_CloudTalentSolution_Resource_ProjectsTenantsCompanies');
|
---|