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\CloudMachineLearningEngine\Resource;
19
20use Google\Service\CloudMachineLearningEngine\GoogleApiHttpBody;
21use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1ExplainRequest;
22use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1GetConfigResponse;
23use Google\Service\CloudMachineLearningEngine\GoogleCloudMlV1PredictRequest;
24
25/**
26 * The "projects" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $mlService = new Google\Service\CloudMachineLearningEngine(...);
30 *   $projects = $mlService->projects;
31 *  </code>
32 */
33class Projects extends \Google\Service\Resource
34{
35  /**
36   * Performs explanation on the data in the request. {% dynamic include "/ai-
37   * platform/includes/___explain-request" %}  (projects.explain)
38   *
39   * @param string $name Required. The resource name of a model or a version.
40   * Authorization: requires the `predict` permission on the specified resource.
41   * @param GoogleCloudMlV1ExplainRequest $postBody
42   * @param array $optParams Optional parameters.
43   * @return GoogleApiHttpBody
44   */
45  public function explain($name, GoogleCloudMlV1ExplainRequest $postBody, $optParams = [])
46  {
47    $params = ['name' => $name, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('explain', [$params], GoogleApiHttpBody::class);
50  }
51  /**
52   * Get the service account information associated with your project. You need
53   * this information in order to grant the service account permissions for the
54   * Google Cloud Storage location where you put your model training code for
55   * training the model with Google Cloud Machine Learning. (projects.getConfig)
56   *
57   * @param string $name Required. The project name.
58   * @param array $optParams Optional parameters.
59   * @return GoogleCloudMlV1GetConfigResponse
60   */
61  public function getConfig($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('getConfig', [$params], GoogleCloudMlV1GetConfigResponse::class);
66  }
67  /**
68   * Performs online prediction on the data in the request. {% dynamic include
69   * "/ai-platform/includes/___predict-request" %}  (projects.predict)
70   *
71   * @param string $name Required. The resource name of a model or a version.
72   * Authorization: requires the `predict` permission on the specified resource.
73   * @param GoogleCloudMlV1PredictRequest $postBody
74   * @param array $optParams Optional parameters.
75   * @return GoogleApiHttpBody
76   */
77  public function predict($name, GoogleCloudMlV1PredictRequest $postBody, $optParams = [])
78  {
79    $params = ['name' => $name, 'postBody' => $postBody];
80    $params = array_merge($params, $optParams);
81    return $this->call('predict', [$params], GoogleApiHttpBody::class);
82  }
83}
84
85// Adding a class alias for backwards compatibility with the previous class name.
86class_alias(Projects::class, 'Google_Service_CloudMachineLearningEngine_Resource_Projects');
87