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\Bigquery\Resource;
19
20use Google\Service\Bigquery\ListModelsResponse;
21use Google\Service\Bigquery\Model;
22
23/**
24 * The "models" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $bigqueryService = new Google\Service\Bigquery(...);
28 *   $models = $bigqueryService->models;
29 *  </code>
30 */
31class Models extends \Google\Service\Resource
32{
33  /**
34   * Deletes the model specified by modelId from the dataset. (models.delete)
35   *
36   * @param string $projectId Required. Project ID of the model to delete.
37   * @param string $datasetId Required. Dataset ID of the model to delete.
38   * @param string $modelId Required. Model ID of the model to delete.
39   * @param array $optParams Optional parameters.
40   */
41  public function delete($projectId, $datasetId, $modelId, $optParams = [])
42  {
43    $params = ['projectId' => $projectId, 'datasetId' => $datasetId, 'modelId' => $modelId];
44    $params = array_merge($params, $optParams);
45    return $this->call('delete', [$params]);
46  }
47  /**
48   * Gets the specified model resource by model ID. (models.get)
49   *
50   * @param string $projectId Required. Project ID of the requested model.
51   * @param string $datasetId Required. Dataset ID of the requested model.
52   * @param string $modelId Required. Model ID of the requested model.
53   * @param array $optParams Optional parameters.
54   * @return Model
55   */
56  public function get($projectId, $datasetId, $modelId, $optParams = [])
57  {
58    $params = ['projectId' => $projectId, 'datasetId' => $datasetId, 'modelId' => $modelId];
59    $params = array_merge($params, $optParams);
60    return $this->call('get', [$params], Model::class);
61  }
62  /**
63   * Lists all models in the specified dataset. Requires the READER dataset role.
64   * After retrieving the list of models, you can get information about a
65   * particular model by calling the models.get method. (models.listModels)
66   *
67   * @param string $projectId Required. Project ID of the models to list.
68   * @param string $datasetId Required. Dataset ID of the models to list.
69   * @param array $optParams Optional parameters.
70   *
71   * @opt_param string maxResults The maximum number of results to return in a
72   * single response page. Leverage the page tokens to iterate through the entire
73   * collection.
74   * @opt_param string pageToken Page token, returned by a previous call to
75   * request the next page of results
76   * @return ListModelsResponse
77   */
78  public function listModels($projectId, $datasetId, $optParams = [])
79  {
80    $params = ['projectId' => $projectId, 'datasetId' => $datasetId];
81    $params = array_merge($params, $optParams);
82    return $this->call('list', [$params], ListModelsResponse::class);
83  }
84  /**
85   * Patch specific fields in the specified model. (models.patch)
86   *
87   * @param string $projectId Required. Project ID of the model to patch.
88   * @param string $datasetId Required. Dataset ID of the model to patch.
89   * @param string $modelId Required. Model ID of the model to patch.
90   * @param Model $postBody
91   * @param array $optParams Optional parameters.
92   * @return Model
93   */
94  public function patch($projectId, $datasetId, $modelId, Model $postBody, $optParams = [])
95  {
96    $params = ['projectId' => $projectId, 'datasetId' => $datasetId, 'modelId' => $modelId, 'postBody' => $postBody];
97    $params = array_merge($params, $optParams);
98    return $this->call('patch', [$params], Model::class);
99  }
100}
101
102// Adding a class alias for backwards compatibility with the previous class name.
103class_alias(Models::class, 'Google_Service_Bigquery_Resource_Models');
104