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\Firestore\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Firestore\GoogleFirestoreAdminV1Field;
|
---|
21 | use Google\Service\Firestore\GoogleFirestoreAdminV1ListFieldsResponse;
|
---|
22 | use Google\Service\Firestore\GoogleLongrunningOperation;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "fields" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $firestoreService = new Google\Service\Firestore(...);
|
---|
29 | * $fields = $firestoreService->projects_databases_collectionGroups_fields;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsDatabasesCollectionGroupsFields extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Gets the metadata and configuration for a Field. (fields.get)
|
---|
36 | *
|
---|
37 | * @param string $name Required. A name of the form `projects/{project_id}/datab
|
---|
38 | * ases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | * @return GoogleFirestoreAdminV1Field
|
---|
41 | * @throws \Google\Service\Exception
|
---|
42 | */
|
---|
43 | public function get($name, $optParams = [])
|
---|
44 | {
|
---|
45 | $params = ['name' => $name];
|
---|
46 | $params = array_merge($params, $optParams);
|
---|
47 | return $this->call('get', [$params], GoogleFirestoreAdminV1Field::class);
|
---|
48 | }
|
---|
49 | /**
|
---|
50 | * Lists the field configuration and metadata for this database. Currently,
|
---|
51 | * FirestoreAdmin.ListFields only supports listing fields that have been
|
---|
52 | * explicitly overridden. To issue this query, call FirestoreAdmin.ListFields
|
---|
53 | * with the filter set to `indexConfig.usesAncestorConfig:false` or
|
---|
54 | * `ttlConfig:*`. (fields.listProjectsDatabasesCollectionGroupsFields)
|
---|
55 | *
|
---|
56 | * @param string $parent Required. A parent name of the form `projects/{project_
|
---|
57 | * id}/databases/{database_id}/collectionGroups/{collection_id}`
|
---|
58 | * @param array $optParams Optional parameters.
|
---|
59 | *
|
---|
60 | * @opt_param string filter The filter to apply to list results. Currently,
|
---|
61 | * FirestoreAdmin.ListFields only supports listing fields that have been
|
---|
62 | * explicitly overridden. To issue this query, call FirestoreAdmin.ListFields
|
---|
63 | * with a filter that includes `indexConfig.usesAncestorConfig:false` or
|
---|
64 | * `ttlConfig:*`.
|
---|
65 | * @opt_param int pageSize The number of results to return.
|
---|
66 | * @opt_param string pageToken A page token, returned from a previous call to
|
---|
67 | * FirestoreAdmin.ListFields, that may be used to get the next page of results.
|
---|
68 | * @return GoogleFirestoreAdminV1ListFieldsResponse
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function listProjectsDatabasesCollectionGroupsFields($parent, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['parent' => $parent];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('list', [$params], GoogleFirestoreAdminV1ListFieldsResponse::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Updates a field configuration. Currently, field updates apply only to single
|
---|
79 | * field index configuration. However, calls to FirestoreAdmin.UpdateField
|
---|
80 | * should provide a field mask to avoid changing any configuration that the
|
---|
81 | * caller isn't aware of. The field mask should be specified as: `{ paths:
|
---|
82 | * "index_config" }`. This call returns a google.longrunning.Operation which may
|
---|
83 | * be used to track the status of the field update. The metadata for the
|
---|
84 | * operation will be the type FieldOperationMetadata. To configure the default
|
---|
85 | * field settings for the database, use the special `Field` with resource name:
|
---|
86 | * `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/f
|
---|
87 | * ields`. (fields.patch)
|
---|
88 | *
|
---|
89 | * @param string $name Required. A field name of the form: `projects/{project_id
|
---|
90 | * }/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path
|
---|
91 | * }` A field path can be a simple field name, e.g. `address` or a path to
|
---|
92 | * fields within `map_value` , e.g. `address.city`, or a special field path. The
|
---|
93 | * only valid special field is `*`, which represents any field. Field paths can
|
---|
94 | * be quoted using `` ` `` (backtick). The only character that must be escaped
|
---|
95 | * within a quoted field path is the backtick character itself, escaped using a
|
---|
96 | * backslash. Special characters in field paths that must be quoted include:
|
---|
97 | * `*`, `.`, `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic
|
---|
98 | * characters. Examples: `` `address.city` `` represents a field named
|
---|
99 | * `address.city`, not the map key `city` in the field `address`. `` `*` ``
|
---|
100 | * represents a field named `*`, not any field. A special `Field` contains the
|
---|
101 | * default indexing settings for all fields. This field's resource name is: `pro
|
---|
102 | * jects/{project_id}/databases/{database_id}/collectionGroups/__default__/field
|
---|
103 | * s` Indexes defined on this `Field` will be applied to all fields which do not
|
---|
104 | * have their own `Field` index configuration.
|
---|
105 | * @param GoogleFirestoreAdminV1Field $postBody
|
---|
106 | * @param array $optParams Optional parameters.
|
---|
107 | *
|
---|
108 | * @opt_param string updateMask A mask, relative to the field. If specified,
|
---|
109 | * only configuration specified by this field_mask will be updated in the field.
|
---|
110 | * @return GoogleLongrunningOperation
|
---|
111 | * @throws \Google\Service\Exception
|
---|
112 | */
|
---|
113 | public function patch($name, GoogleFirestoreAdminV1Field $postBody, $optParams = [])
|
---|
114 | {
|
---|
115 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
116 | $params = array_merge($params, $optParams);
|
---|
117 | return $this->call('patch', [$params], GoogleLongrunningOperation::class);
|
---|
118 | }
|
---|
119 | }
|
---|
120 |
|
---|
121 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
122 | class_alias(ProjectsDatabasesCollectionGroupsFields::class, 'Google_Service_Firestore_Resource_ProjectsDatabasesCollectionGroupsFields');
|
---|