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\RecommendationsAI\Resource;
19
20use Google\Service\RecommendationsAI\GoogleCloudRecommendationengineV1beta1CreatePredictionApiKeyRegistrationRequest;
21use Google\Service\RecommendationsAI\GoogleCloudRecommendationengineV1beta1ListPredictionApiKeyRegistrationsResponse;
22use Google\Service\RecommendationsAI\GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration;
23use Google\Service\RecommendationsAI\GoogleProtobufEmpty;
24
25/**
26 * The "predictionApiKeyRegistrations" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $recommendationengineService = new Google\Service\RecommendationsAI(...);
30 *   $predictionApiKeyRegistrations = $recommendationengineService->predictionApiKeyRegistrations;
31 *  </code>
32 */
33class ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrations extends \Google\Service\Resource
34{
35  /**
36   * Register an API key for use with predict method.
37   * (predictionApiKeyRegistrations.create)
38   *
39   * @param string $parent Required. The parent resource path. `projects/locations
40   * /global/catalogs/default_catalog/eventStores/default_event_store`.
41   * @param GoogleCloudRecommendationengineV1beta1CreatePredictionApiKeyRegistrationRequest $postBody
42   * @param array $optParams Optional parameters.
43   * @return GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration
44   */
45  public function create($parent, GoogleCloudRecommendationengineV1beta1CreatePredictionApiKeyRegistrationRequest $postBody, $optParams = [])
46  {
47    $params = ['parent' => $parent, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], GoogleCloudRecommendationengineV1beta1PredictionApiKeyRegistration::class);
50  }
51  /**
52   * Unregister an apiKey from using for predict method.
53   * (predictionApiKeyRegistrations.delete)
54   *
55   * @param string $name Required. The API key to unregister including full
56   * resource path. `projects/locations/global/catalogs/default_catalog/eventStore
57   * s/default_event_store/predictionApiKeyRegistrations/`
58   * @param array $optParams Optional parameters.
59   * @return GoogleProtobufEmpty
60   */
61  public function delete($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
66  }
67  /**
68   * List the registered apiKeys for use with predict method. (predictionApiKeyReg
69   * istrations.listProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrati
70   * ons)
71   *
72   * @param string $parent Required. The parent placement resource name such as `p
73   * rojects/1234/locations/global/catalogs/default_catalog/eventStores/default_ev
74   * ent_store`
75   * @param array $optParams Optional parameters.
76   *
77   * @opt_param int pageSize Optional. Maximum number of results to return per
78   * page. If unset, the service will choose a reasonable default.
79   * @opt_param string pageToken Optional. The previous
80   * `ListPredictionApiKeyRegistration.nextPageToken`.
81   * @return GoogleCloudRecommendationengineV1beta1ListPredictionApiKeyRegistrationsResponse
82   */
83  public function listProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrations($parent, $optParams = [])
84  {
85    $params = ['parent' => $parent];
86    $params = array_merge($params, $optParams);
87    return $this->call('list', [$params], GoogleCloudRecommendationengineV1beta1ListPredictionApiKeyRegistrationsResponse::class);
88  }
89}
90
91// Adding a class alias for backwards compatibility with the previous class name.
92class_alias(ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrations::class, 'Google_Service_RecommendationsAI_Resource_ProjectsLocationsCatalogsEventStoresPredictionApiKeyRegistrations');
93