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