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