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\Apigee\Resource;
19
20use Google\Service\Apigee\GoogleCloudApigeeV1Datastore;
21use Google\Service\Apigee\GoogleCloudApigeeV1ListDatastoresResponse;
22use Google\Service\Apigee\GoogleCloudApigeeV1TestDatastoreResponse;
23use Google\Service\Apigee\GoogleProtobufEmpty;
24
25/**
26 * The "datastores" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $apigeeService = new Google\Service\Apigee(...);
30 *   $datastores = $apigeeService->datastores;
31 *  </code>
32 */
33class OrganizationsAnalyticsDatastores extends \Google\Service\Resource
34{
35  /**
36   * Create a Datastore for an org (datastores.create)
37   *
38   * @param string $parent Required. The parent organization name. Must be of the
39   * form `organizations/{org}`.
40   * @param GoogleCloudApigeeV1Datastore $postBody
41   * @param array $optParams Optional parameters.
42   * @return GoogleCloudApigeeV1Datastore
43   */
44  public function create($parent, GoogleCloudApigeeV1Datastore $postBody, $optParams = [])
45  {
46    $params = ['parent' => $parent, 'postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('create', [$params], GoogleCloudApigeeV1Datastore::class);
49  }
50  /**
51   * Delete a Datastore from an org. (datastores.delete)
52   *
53   * @param string $name Required. Resource name of the Datastore to be deleted.
54   * Must be of the form `organizations/{org}/analytics/datastores/{datastoreId}`
55   * @param array $optParams Optional parameters.
56   * @return GoogleProtobufEmpty
57   */
58  public function delete($name, $optParams = [])
59  {
60    $params = ['name' => $name];
61    $params = array_merge($params, $optParams);
62    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
63  }
64  /**
65   * Get a Datastore (datastores.get)
66   *
67   * @param string $name Required. Resource name of the Datastore to be get. Must
68   * be of the form `organizations/{org}/analytics/datastores/{datastoreId}`
69   * @param array $optParams Optional parameters.
70   * @return GoogleCloudApigeeV1Datastore
71   */
72  public function get($name, $optParams = [])
73  {
74    $params = ['name' => $name];
75    $params = array_merge($params, $optParams);
76    return $this->call('get', [$params], GoogleCloudApigeeV1Datastore::class);
77  }
78  /**
79   * List Datastores (datastores.listOrganizationsAnalyticsDatastores)
80   *
81   * @param string $parent Required. The parent organization name. Must be of the
82   * form `organizations/{org}`.
83   * @param array $optParams Optional parameters.
84   *
85   * @opt_param string targetType Optional. TargetType is used to fetch all
86   * Datastores that match the type
87   * @return GoogleCloudApigeeV1ListDatastoresResponse
88   */
89  public function listOrganizationsAnalyticsDatastores($parent, $optParams = [])
90  {
91    $params = ['parent' => $parent];
92    $params = array_merge($params, $optParams);
93    return $this->call('list', [$params], GoogleCloudApigeeV1ListDatastoresResponse::class);
94  }
95  /**
96   * Test if Datastore configuration is correct. This includes checking if
97   * credentials provided by customer have required permissions in target
98   * destination storage (datastores.test)
99   *
100   * @param string $parent Required. The parent organization name Must be of the
101   * form `organizations/{org}`
102   * @param GoogleCloudApigeeV1Datastore $postBody
103   * @param array $optParams Optional parameters.
104   * @return GoogleCloudApigeeV1TestDatastoreResponse
105   */
106  public function test($parent, GoogleCloudApigeeV1Datastore $postBody, $optParams = [])
107  {
108    $params = ['parent' => $parent, 'postBody' => $postBody];
109    $params = array_merge($params, $optParams);
110    return $this->call('test', [$params], GoogleCloudApigeeV1TestDatastoreResponse::class);
111  }
112  /**
113   * Update a Datastore (datastores.update)
114   *
115   * @param string $name Required. The resource name of datastore to be updated.
116   * Must be of the form `organizations/{org}/analytics/datastores/{datastoreId}`
117   * @param GoogleCloudApigeeV1Datastore $postBody
118   * @param array $optParams Optional parameters.
119   * @return GoogleCloudApigeeV1Datastore
120   */
121  public function update($name, GoogleCloudApigeeV1Datastore $postBody, $optParams = [])
122  {
123    $params = ['name' => $name, 'postBody' => $postBody];
124    $params = array_merge($params, $optParams);
125    return $this->call('update', [$params], GoogleCloudApigeeV1Datastore::class);
126  }
127}
128
129// Adding a class alias for backwards compatibility with the previous class name.
130class_alias(OrganizationsAnalyticsDatastores::class, 'Google_Service_Apigee_Resource_OrganizationsAnalyticsDatastores');
131