Initial commit: Complete WooCommerce Smart Google Pricing plugin with vendor dependencies

This commit is contained in:
2025-12-23 07:48:45 +01:00
commit 9b66109ca1
32472 changed files with 4065017 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
/**
* The "projects" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $projects = $firestoreService->projects;
* </code>
*/
class Projects extends \Google\Service\Resource
{
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Projects::class, 'Google_Service_Firestore_Resource_Projects');

View File

@@ -0,0 +1,251 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
use Google\Service\Firestore\GoogleFirestoreAdminV1BulkDeleteDocumentsRequest;
use Google\Service\Firestore\GoogleFirestoreAdminV1CloneDatabaseRequest;
use Google\Service\Firestore\GoogleFirestoreAdminV1Database;
use Google\Service\Firestore\GoogleFirestoreAdminV1ExportDocumentsRequest;
use Google\Service\Firestore\GoogleFirestoreAdminV1ImportDocumentsRequest;
use Google\Service\Firestore\GoogleFirestoreAdminV1ListDatabasesResponse;
use Google\Service\Firestore\GoogleFirestoreAdminV1RestoreDatabaseRequest;
use Google\Service\Firestore\GoogleLongrunningOperation;
/**
* The "databases" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $databases = $firestoreService->projects_databases;
* </code>
*/
class ProjectsDatabases extends \Google\Service\Resource
{
/**
* Bulk deletes a subset of documents from Google Cloud Firestore. Documents
* created or updated after the underlying system starts to process the request
* will not be deleted. The bulk delete occurs in the background and its
* progress can be monitored and managed via the Operation resource that is
* created. For more details on bulk delete behavior, refer to:
* https://cloud.google.com/firestore/docs/manage-data/bulk-delete
* (databases.bulkDeleteDocuments)
*
* @param string $name Required. Database to operate. Should be of the form:
* `projects/{project_id}/databases/{database_id}`.
* @param GoogleFirestoreAdminV1BulkDeleteDocumentsRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function bulkDeleteDocuments($name, GoogleFirestoreAdminV1BulkDeleteDocumentsRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('bulkDeleteDocuments', [$params], GoogleLongrunningOperation::class);
}
/**
* Creates a new database by cloning an existing one. The new database must be
* in the same cloud region or multi-region location as the existing database.
* This behaves similar to FirestoreAdmin.CreateDatabase except instead of
* creating a new empty database, a new database is created with the database
* type, index configuration, and documents from an existing database. The long-
* running operation can be used to track the progress of the clone, with the
* Operation's metadata field type being the CloneDatabaseMetadata. The response
* type is the Database if the clone was successful. The new database is not
* readable or writeable until the LRO has completed.
* (databases.cloneProjectsDatabases)
*
* @param string $parent Required. The project to clone the database in. Format
* is `projects/{project_id}`.
* @param GoogleFirestoreAdminV1CloneDatabaseRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function cloneProjectsDatabases($parent, GoogleFirestoreAdminV1CloneDatabaseRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('clone', [$params], GoogleLongrunningOperation::class);
}
/**
* Create a database. (databases.create)
*
* @param string $parent Required. A parent name of the form
* `projects/{project_id}`
* @param GoogleFirestoreAdminV1Database $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string databaseId Required. The ID to use for the database, which
* will become the final component of the database's resource name. This value
* should be 4-63 characters. Valid characters are /a-z-/ with first character a
* letter and the last a letter or a number. Must not be UUID-like
* /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. "(default)" database ID is also
* valid if the database is Standard edition.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function create($parent, GoogleFirestoreAdminV1Database $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], GoogleLongrunningOperation::class);
}
/**
* Deletes a database. (databases.delete)
*
* @param string $name Required. A name of the form
* `projects/{project_id}/databases/{database_id}`
* @param array $optParams Optional parameters.
*
* @opt_param string etag The current etag of the Database. If an etag is
* provided and does not match the current etag of the database, deletion will
* be blocked and a FAILED_PRECONDITION error will be returned.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], GoogleLongrunningOperation::class);
}
/**
* Exports a copy of all or a subset of documents from Google Cloud Firestore to
* another storage system, such as Google Cloud Storage. Recent updates to
* documents may not be reflected in the export. The export occurs in the
* background and its progress can be monitored and managed via the Operation
* resource that is created. The output of an export may only be used once the
* associated operation is done. If an export operation is cancelled before
* completion it may leave partial data behind in Google Cloud Storage. For more
* details on export behavior and output format, refer to:
* https://cloud.google.com/firestore/docs/manage-data/export-import
* (databases.exportDocuments)
*
* @param string $name Required. Database to export. Should be of the form:
* `projects/{project_id}/databases/{database_id}`.
* @param GoogleFirestoreAdminV1ExportDocumentsRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function exportDocuments($name, GoogleFirestoreAdminV1ExportDocumentsRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('exportDocuments', [$params], GoogleLongrunningOperation::class);
}
/**
* Gets information about a database. (databases.get)
*
* @param string $name Required. A name of the form
* `projects/{project_id}/databases/{database_id}`
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1Database
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GoogleFirestoreAdminV1Database::class);
}
/**
* Imports documents into Google Cloud Firestore. Existing documents with the
* same name are overwritten. The import occurs in the background and its
* progress can be monitored and managed via the Operation resource that is
* created. If an ImportDocuments operation is cancelled, it is possible that a
* subset of the data has already been imported to Cloud Firestore.
* (databases.importDocuments)
*
* @param string $name Required. Database to import into. Should be of the form:
* `projects/{project_id}/databases/{database_id}`.
* @param GoogleFirestoreAdminV1ImportDocumentsRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function importDocuments($name, GoogleFirestoreAdminV1ImportDocumentsRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('importDocuments', [$params], GoogleLongrunningOperation::class);
}
/**
* List all the databases in the project. (databases.listProjectsDatabases)
*
* @param string $parent Required. A parent name of the form
* `projects/{project_id}`
* @param array $optParams Optional parameters.
*
* @opt_param bool showDeleted If true, also returns deleted resources.
* @return GoogleFirestoreAdminV1ListDatabasesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsDatabases($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], GoogleFirestoreAdminV1ListDatabasesResponse::class);
}
/**
* Updates a database. (databases.patch)
*
* @param string $name The resource name of the Database. Format:
* `projects/{project}/databases/{database}`
* @param GoogleFirestoreAdminV1Database $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string updateMask The list of fields to be updated.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function patch($name, GoogleFirestoreAdminV1Database $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], GoogleLongrunningOperation::class);
}
/**
* Creates a new database by restoring from an existing backup. The new database
* must be in the same cloud region or multi-region location as the existing
* backup. This behaves similar to FirestoreAdmin.CreateDatabase except instead
* of creating a new empty database, a new database is created with the database
* type, index configuration, and documents from an existing backup. The long-
* running operation can be used to track the progress of the restore, with the
* Operation's metadata field type being the RestoreDatabaseMetadata. The
* response type is the Database if the restore was successful. The new database
* is not readable or writeable until the LRO has completed. (databases.restore)
*
* @param string $parent Required. The project to restore the database in.
* Format is `projects/{project_id}`.
* @param GoogleFirestoreAdminV1RestoreDatabaseRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function restore($parent, GoogleFirestoreAdminV1RestoreDatabaseRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('restore', [$params], GoogleLongrunningOperation::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsDatabases::class, 'Google_Service_Firestore_Resource_ProjectsDatabases');

View File

@@ -0,0 +1,120 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
use Google\Service\Firestore\FirestoreEmpty;
use Google\Service\Firestore\GoogleFirestoreAdminV1BackupSchedule;
use Google\Service\Firestore\GoogleFirestoreAdminV1ListBackupSchedulesResponse;
/**
* The "backupSchedules" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $backupSchedules = $firestoreService->projects_databases_backupSchedules;
* </code>
*/
class ProjectsDatabasesBackupSchedules extends \Google\Service\Resource
{
/**
* Creates a backup schedule on a database. At most two backup schedules can be
* configured on a database, one daily backup schedule and one weekly backup
* schedule. (backupSchedules.create)
*
* @param string $parent Required. The parent database. Format
* `projects/{project}/databases/{database}`
* @param GoogleFirestoreAdminV1BackupSchedule $postBody
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1BackupSchedule
* @throws \Google\Service\Exception
*/
public function create($parent, GoogleFirestoreAdminV1BackupSchedule $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], GoogleFirestoreAdminV1BackupSchedule::class);
}
/**
* Deletes a backup schedule. (backupSchedules.delete)
*
* @param string $name Required. The name of the backup schedule. Format
* `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
* @param array $optParams Optional parameters.
* @return FirestoreEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], FirestoreEmpty::class);
}
/**
* Gets information about a backup schedule. (backupSchedules.get)
*
* @param string $name Required. The name of the backup schedule. Format
* `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1BackupSchedule
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GoogleFirestoreAdminV1BackupSchedule::class);
}
/**
* List backup schedules. (backupSchedules.listProjectsDatabasesBackupSchedules)
*
* @param string $parent Required. The parent database. Format is
* `projects/{project}/databases/{database}`.
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1ListBackupSchedulesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsDatabasesBackupSchedules($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], GoogleFirestoreAdminV1ListBackupSchedulesResponse::class);
}
/**
* Updates a backup schedule. (backupSchedules.patch)
*
* @param string $name Output only. The unique backup schedule identifier across
* all locations and databases for the given project. This will be auto-
* assigned. Format is
* `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
* @param GoogleFirestoreAdminV1BackupSchedule $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string updateMask The list of fields to be updated.
* @return GoogleFirestoreAdminV1BackupSchedule
* @throws \Google\Service\Exception
*/
public function patch($name, GoogleFirestoreAdminV1BackupSchedule $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], GoogleFirestoreAdminV1BackupSchedule::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsDatabasesBackupSchedules::class, 'Google_Service_Firestore_Resource_ProjectsDatabasesBackupSchedules');

View File

@@ -0,0 +1,33 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
/**
* The "collectionGroups" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $collectionGroups = $firestoreService->projects_databases_collectionGroups;
* </code>
*/
class ProjectsDatabasesCollectionGroups extends \Google\Service\Resource
{
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsDatabasesCollectionGroups::class, 'Google_Service_Firestore_Resource_ProjectsDatabasesCollectionGroups');

View File

@@ -0,0 +1,122 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
use Google\Service\Firestore\GoogleFirestoreAdminV1Field;
use Google\Service\Firestore\GoogleFirestoreAdminV1ListFieldsResponse;
use Google\Service\Firestore\GoogleLongrunningOperation;
/**
* The "fields" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $fields = $firestoreService->projects_databases_collectionGroups_fields;
* </code>
*/
class ProjectsDatabasesCollectionGroupsFields extends \Google\Service\Resource
{
/**
* Gets the metadata and configuration for a Field. (fields.get)
*
* @param string $name Required. A name of the form `projects/{project_id}/datab
* ases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1Field
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GoogleFirestoreAdminV1Field::class);
}
/**
* Lists the field configuration and metadata for this database. Currently,
* FirestoreAdmin.ListFields only supports listing fields that have been
* explicitly overridden. To issue this query, call FirestoreAdmin.ListFields
* with the filter set to `indexConfig.usesAncestorConfig:false` or
* `ttlConfig:*`. (fields.listProjectsDatabasesCollectionGroupsFields)
*
* @param string $parent Required. A parent name of the form `projects/{project_
* id}/databases/{database_id}/collectionGroups/{collection_id}`
* @param array $optParams Optional parameters.
*
* @opt_param string filter The filter to apply to list results. Currently,
* FirestoreAdmin.ListFields only supports listing fields that have been
* explicitly overridden. To issue this query, call FirestoreAdmin.ListFields
* with a filter that includes `indexConfig.usesAncestorConfig:false` or
* `ttlConfig:*`.
* @opt_param int pageSize The number of results to return.
* @opt_param string pageToken A page token, returned from a previous call to
* FirestoreAdmin.ListFields, that may be used to get the next page of results.
* @return GoogleFirestoreAdminV1ListFieldsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsDatabasesCollectionGroupsFields($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], GoogleFirestoreAdminV1ListFieldsResponse::class);
}
/**
* Updates a field configuration. Currently, field updates apply only to single
* field index configuration. However, calls to FirestoreAdmin.UpdateField
* should provide a field mask to avoid changing any configuration that the
* caller isn't aware of. The field mask should be specified as: `{ paths:
* "index_config" }`. This call returns a google.longrunning.Operation which may
* be used to track the status of the field update. The metadata for the
* operation will be the type FieldOperationMetadata. To configure the default
* field settings for the database, use the special `Field` with resource name:
* `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/f
* ields`. (fields.patch)
*
* @param string $name Required. A field name of the form: `projects/{project_id
* }/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path
* }` A field path can be a simple field name, e.g. `address` or a path to
* fields within `map_value` , e.g. `address.city`, or a special field path. The
* only valid special field is `*`, which represents any field. Field paths can
* be quoted using `` ` `` (backtick). The only character that must be escaped
* within a quoted field path is the backtick character itself, escaped using a
* backslash. Special characters in field paths that must be quoted include:
* `*`, `.`, `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic
* characters. Examples: `` `address.city` `` represents a field named
* `address.city`, not the map key `city` in the field `address`. `` `*` ``
* represents a field named `*`, not any field. A special `Field` contains the
* default indexing settings for all fields. This field's resource name is: `pro
* jects/{project_id}/databases/{database_id}/collectionGroups/__default__/field
* s` Indexes defined on this `Field` will be applied to all fields which do not
* have their own `Field` index configuration.
* @param GoogleFirestoreAdminV1Field $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string updateMask A mask, relative to the field. If specified,
* only configuration specified by this field_mask will be updated in the field.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function patch($name, GoogleFirestoreAdminV1Field $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], GoogleLongrunningOperation::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsDatabasesCollectionGroupsFields::class, 'Google_Service_Firestore_Resource_ProjectsDatabasesCollectionGroupsFields');

View File

@@ -0,0 +1,107 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
use Google\Service\Firestore\FirestoreEmpty;
use Google\Service\Firestore\GoogleFirestoreAdminV1Index;
use Google\Service\Firestore\GoogleFirestoreAdminV1ListIndexesResponse;
use Google\Service\Firestore\GoogleLongrunningOperation;
/**
* The "indexes" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $indexes = $firestoreService->projects_databases_collectionGroups_indexes;
* </code>
*/
class ProjectsDatabasesCollectionGroupsIndexes extends \Google\Service\Resource
{
/**
* Creates a composite index. This returns a google.longrunning.Operation which
* may be used to track the status of the creation. The metadata for the
* operation will be the type IndexOperationMetadata. (indexes.create)
*
* @param string $parent Required. A parent name of the form `projects/{project_
* id}/databases/{database_id}/collectionGroups/{collection_id}`
* @param GoogleFirestoreAdminV1Index $postBody
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function create($parent, GoogleFirestoreAdminV1Index $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], GoogleLongrunningOperation::class);
}
/**
* Deletes a composite index. (indexes.delete)
*
* @param string $name Required. A name of the form `projects/{project_id}/datab
* ases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
* @param array $optParams Optional parameters.
* @return FirestoreEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], FirestoreEmpty::class);
}
/**
* Gets a composite index. (indexes.get)
*
* @param string $name Required. A name of the form `projects/{project_id}/datab
* ases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1Index
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GoogleFirestoreAdminV1Index::class);
}
/**
* Lists composite indexes.
* (indexes.listProjectsDatabasesCollectionGroupsIndexes)
*
* @param string $parent Required. A parent name of the form `projects/{project_
* id}/databases/{database_id}/collectionGroups/{collection_id}`
* @param array $optParams Optional parameters.
*
* @opt_param string filter The filter to apply to list results.
* @opt_param int pageSize The number of results to return.
* @opt_param string pageToken A page token, returned from a previous call to
* FirestoreAdmin.ListIndexes, that may be used to get the next page of results.
* @return GoogleFirestoreAdminV1ListIndexesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsDatabasesCollectionGroupsIndexes($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], GoogleFirestoreAdminV1ListIndexesResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsDatabasesCollectionGroupsIndexes::class, 'Google_Service_Firestore_Resource_ProjectsDatabasesCollectionGroupsIndexes');

View File

@@ -0,0 +1,468 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
use Google\Service\Firestore\BatchGetDocumentsRequest;
use Google\Service\Firestore\BatchGetDocumentsResponse;
use Google\Service\Firestore\BatchWriteRequest;
use Google\Service\Firestore\BatchWriteResponse;
use Google\Service\Firestore\BeginTransactionRequest;
use Google\Service\Firestore\BeginTransactionResponse;
use Google\Service\Firestore\CommitRequest;
use Google\Service\Firestore\CommitResponse;
use Google\Service\Firestore\Document;
use Google\Service\Firestore\ExecutePipelineRequest;
use Google\Service\Firestore\ExecutePipelineResponse;
use Google\Service\Firestore\FirestoreEmpty;
use Google\Service\Firestore\ListCollectionIdsRequest;
use Google\Service\Firestore\ListCollectionIdsResponse;
use Google\Service\Firestore\ListDocumentsResponse;
use Google\Service\Firestore\ListenRequest;
use Google\Service\Firestore\ListenResponse;
use Google\Service\Firestore\PartitionQueryRequest;
use Google\Service\Firestore\PartitionQueryResponse;
use Google\Service\Firestore\RollbackRequest;
use Google\Service\Firestore\RunAggregationQueryRequest;
use Google\Service\Firestore\RunAggregationQueryResponse;
use Google\Service\Firestore\RunQueryRequest;
use Google\Service\Firestore\RunQueryResponse;
use Google\Service\Firestore\WriteRequest;
use Google\Service\Firestore\WriteResponse;
/**
* The "documents" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $documents = $firestoreService->projects_databases_documents;
* </code>
*/
class ProjectsDatabasesDocuments extends \Google\Service\Resource
{
/**
* Gets multiple documents. Documents returned by this method are not guaranteed
* to be returned in the same order that they were requested.
* (documents.batchGet)
*
* @param string $database Required. The database name. In the format:
* `projects/{project_id}/databases/{database_id}`.
* @param BatchGetDocumentsRequest $postBody
* @param array $optParams Optional parameters.
* @return BatchGetDocumentsResponse
* @throws \Google\Service\Exception
*/
public function batchGet($database, BatchGetDocumentsRequest $postBody, $optParams = [])
{
$params = ['database' => $database, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('batchGet', [$params], BatchGetDocumentsResponse::class);
}
/**
* Applies a batch of write operations. The BatchWrite method does not apply the
* write operations atomically and can apply them out of order. Method does not
* allow more than one write per document. Each write succeeds or fails
* independently. See the BatchWriteResponse for the success status of each
* write. If you require an atomically applied set of writes, use Commit
* instead. (documents.batchWrite)
*
* @param string $database Required. The database name. In the format:
* `projects/{project_id}/databases/{database_id}`.
* @param BatchWriteRequest $postBody
* @param array $optParams Optional parameters.
* @return BatchWriteResponse
* @throws \Google\Service\Exception
*/
public function batchWrite($database, BatchWriteRequest $postBody, $optParams = [])
{
$params = ['database' => $database, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('batchWrite', [$params], BatchWriteResponse::class);
}
/**
* Starts a new transaction. (documents.beginTransaction)
*
* @param string $database Required. The database name. In the format:
* `projects/{project_id}/databases/{database_id}`.
* @param BeginTransactionRequest $postBody
* @param array $optParams Optional parameters.
* @return BeginTransactionResponse
* @throws \Google\Service\Exception
*/
public function beginTransaction($database, BeginTransactionRequest $postBody, $optParams = [])
{
$params = ['database' => $database, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('beginTransaction', [$params], BeginTransactionResponse::class);
}
/**
* Commits a transaction, while optionally updating documents.
* (documents.commit)
*
* @param string $database Required. The database name. In the format:
* `projects/{project_id}/databases/{database_id}`.
* @param CommitRequest $postBody
* @param array $optParams Optional parameters.
* @return CommitResponse
* @throws \Google\Service\Exception
*/
public function commit($database, CommitRequest $postBody, $optParams = [])
{
$params = ['database' => $database, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('commit', [$params], CommitResponse::class);
}
/**
* Creates a new document. (documents.createDocument)
*
* @param string $parent Required. The parent resource. For example:
* `projects/{project_id}/databases/{database_id}/documents` or `projects/{proje
* ct_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
* @param string $collectionId Required. The collection ID, relative to
* `parent`, to list. For example: `chatrooms`.
* @param Document $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string documentId The client-assigned document ID to use for this
* document. Optional. If not specified, an ID will be assigned by the service.
* @opt_param string mask.fieldPaths The list of field paths in the mask. See
* Document.fields for a field path syntax reference.
* @return Document
* @throws \Google\Service\Exception
*/
public function createDocument($parent, $collectionId, Document $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'collectionId' => $collectionId, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('createDocument', [$params], Document::class);
}
/**
* Deletes a document. (documents.delete)
*
* @param string $name Required. The resource name of the Document to delete. In
* the format:
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
* @param array $optParams Optional parameters.
*
* @opt_param bool currentDocument.exists When set to `true`, the target
* document must exist. When set to `false`, the target document must not exist.
* @opt_param string currentDocument.updateTime When set, the target document
* must exist and have been last updated at that time. Timestamp must be
* microsecond aligned.
* @return FirestoreEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], FirestoreEmpty::class);
}
/**
* Executes a pipeline query. (documents.executePipeline)
*
* @param string $database Required. Database identifier, in the form
* `projects/{project}/databases/{database}`.
* @param ExecutePipelineRequest $postBody
* @param array $optParams Optional parameters.
* @return ExecutePipelineResponse
* @throws \Google\Service\Exception
*/
public function executePipeline($database, ExecutePipelineRequest $postBody, $optParams = [])
{
$params = ['database' => $database, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('executePipeline', [$params], ExecutePipelineResponse::class);
}
/**
* Gets a single document. (documents.get)
*
* @param string $name Required. The resource name of the Document to get. In
* the format:
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
* @param array $optParams Optional parameters.
*
* @opt_param string mask.fieldPaths The list of field paths in the mask. See
* Document.fields for a field path syntax reference.
* @opt_param string readTime Reads the version of the document at the given
* time. This must be a microsecond precision timestamp within the past one
* hour, or if Point-in-Time Recovery is enabled, can additionally be a whole
* minute timestamp within the past 7 days.
* @opt_param string transaction Reads the document in a transaction.
* @return Document
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Document::class);
}
/**
* Lists documents. (documents.listProjectsDatabasesDocuments)
*
* @param string $parent Required. The parent resource name. In the format:
* `projects/{project_id}/databases/{database_id}/documents` or
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
* For example: `projects/my-project/databases/my-database/documents` or
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
* @param string $collectionId Optional. The collection ID, relative to
* `parent`, to list. For example: `chatrooms` or `messages`. This is optional,
* and when not provided, Firestore will list documents from all collections
* under the provided `parent`.
* @param array $optParams Optional parameters.
*
* @opt_param string mask.fieldPaths The list of field paths in the mask. See
* Document.fields for a field path syntax reference.
* @opt_param string orderBy Optional. The optional ordering of the documents to
* return. For example: `priority desc, __name__ desc`. This mirrors the `ORDER
* BY` used in Firestore queries but in a string representation. When absent,
* documents are ordered based on `__name__ ASC`.
* @opt_param int pageSize Optional. The maximum number of documents to return
* in a single response. Firestore may return fewer than this value.
* @opt_param string pageToken Optional. A page token, received from a previous
* `ListDocuments` response. Provide this to retrieve the subsequent page. When
* paginating, all other parameters (with the exception of `page_size`) must
* match the values set in the request that generated the page token.
* @opt_param string readTime Perform the read at the provided time. This must
* be a microsecond precision timestamp within the past one hour, or if Point-
* in-Time Recovery is enabled, can additionally be a whole minute timestamp
* within the past 7 days.
* @opt_param bool showMissing If the list should show missing documents. A
* document is missing if it does not exist, but there are sub-documents nested
* underneath it. When true, such missing documents will be returned with a key
* but will not have fields, `create_time`, or `update_time` set. Requests with
* `show_missing` may not specify `where` or `order_by`.
* @opt_param string transaction Perform the read as part of an already active
* transaction.
* @return ListDocumentsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsDatabasesDocuments($parent, $collectionId, $optParams = [])
{
$params = ['parent' => $parent, 'collectionId' => $collectionId];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListDocumentsResponse::class);
}
/**
* Lists all the collection IDs underneath a document.
* (documents.listCollectionIds)
*
* @param string $parent Required. The parent document. In the format:
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
* For example: `projects/my-project/databases/my-
* database/documents/chatrooms/my-chatroom`
* @param ListCollectionIdsRequest $postBody
* @param array $optParams Optional parameters.
* @return ListCollectionIdsResponse
* @throws \Google\Service\Exception
*/
public function listCollectionIds($parent, ListCollectionIdsRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('listCollectionIds', [$params], ListCollectionIdsResponse::class);
}
/**
* Lists documents. (documents.listDocuments)
*
* @param string $parent Required. The parent resource name. In the format:
* `projects/{project_id}/databases/{database_id}/documents` or
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
* For example: `projects/my-project/databases/my-database/documents` or
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
* @param string $collectionId Optional. The collection ID, relative to
* `parent`, to list. For example: `chatrooms` or `messages`. This is optional,
* and when not provided, Firestore will list documents from all collections
* under the provided `parent`.
* @param array $optParams Optional parameters.
*
* @opt_param string mask.fieldPaths The list of field paths in the mask. See
* Document.fields for a field path syntax reference.
* @opt_param string orderBy Optional. The optional ordering of the documents to
* return. For example: `priority desc, __name__ desc`. This mirrors the `ORDER
* BY` used in Firestore queries but in a string representation. When absent,
* documents are ordered based on `__name__ ASC`.
* @opt_param int pageSize Optional. The maximum number of documents to return
* in a single response. Firestore may return fewer than this value.
* @opt_param string pageToken Optional. A page token, received from a previous
* `ListDocuments` response. Provide this to retrieve the subsequent page. When
* paginating, all other parameters (with the exception of `page_size`) must
* match the values set in the request that generated the page token.
* @opt_param string readTime Perform the read at the provided time. This must
* be a microsecond precision timestamp within the past one hour, or if Point-
* in-Time Recovery is enabled, can additionally be a whole minute timestamp
* within the past 7 days.
* @opt_param bool showMissing If the list should show missing documents. A
* document is missing if it does not exist, but there are sub-documents nested
* underneath it. When true, such missing documents will be returned with a key
* but will not have fields, `create_time`, or `update_time` set. Requests with
* `show_missing` may not specify `where` or `order_by`.
* @opt_param string transaction Perform the read as part of an already active
* transaction.
* @return ListDocumentsResponse
* @throws \Google\Service\Exception
*/
public function listDocuments($parent, $collectionId, $optParams = [])
{
$params = ['parent' => $parent, 'collectionId' => $collectionId];
$params = array_merge($params, $optParams);
return $this->call('listDocuments', [$params], ListDocumentsResponse::class);
}
/**
* Listens to changes. This method is only available via gRPC or WebChannel (not
* REST). (documents.listen)
*
* @param string $database Required. The database name. In the format:
* `projects/{project_id}/databases/{database_id}`.
* @param ListenRequest $postBody
* @param array $optParams Optional parameters.
* @return ListenResponse
* @throws \Google\Service\Exception
*/
public function listen($database, ListenRequest $postBody, $optParams = [])
{
$params = ['database' => $database, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('listen', [$params], ListenResponse::class);
}
/**
* Partitions a query by returning partition cursors that can be used to run the
* query in parallel. The returned partition cursors are split points that can
* be used by RunQuery as starting/end points for the query results.
* (documents.partitionQuery)
*
* @param string $parent Required. The parent resource name. In the format:
* `projects/{project_id}/databases/{database_id}/documents`. Document resource
* names are not supported; only database resource names can be specified.
* @param PartitionQueryRequest $postBody
* @param array $optParams Optional parameters.
* @return PartitionQueryResponse
* @throws \Google\Service\Exception
*/
public function partitionQuery($parent, PartitionQueryRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('partitionQuery', [$params], PartitionQueryResponse::class);
}
/**
* Updates or inserts a document. (documents.patch)
*
* @param string $name The resource name of the document, for example
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
* @param Document $postBody
* @param array $optParams Optional parameters.
*
* @opt_param bool currentDocument.exists When set to `true`, the target
* document must exist. When set to `false`, the target document must not exist.
* @opt_param string currentDocument.updateTime When set, the target document
* must exist and have been last updated at that time. Timestamp must be
* microsecond aligned.
* @opt_param string mask.fieldPaths The list of field paths in the mask. See
* Document.fields for a field path syntax reference.
* @opt_param string updateMask.fieldPaths The list of field paths in the mask.
* See Document.fields for a field path syntax reference.
* @return Document
* @throws \Google\Service\Exception
*/
public function patch($name, Document $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], Document::class);
}
/**
* Rolls back a transaction. (documents.rollback)
*
* @param string $database Required. The database name. In the format:
* `projects/{project_id}/databases/{database_id}`.
* @param RollbackRequest $postBody
* @param array $optParams Optional parameters.
* @return FirestoreEmpty
* @throws \Google\Service\Exception
*/
public function rollback($database, RollbackRequest $postBody, $optParams = [])
{
$params = ['database' => $database, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('rollback', [$params], FirestoreEmpty::class);
}
/**
* Runs an aggregation query. Rather than producing Document results like
* Firestore.RunQuery, this API allows running an aggregation to produce a
* series of AggregationResult server-side. High-Level Example: ``` -- Return
* the number of documents in table given a filter. SELECT COUNT(*) FROM (
* SELECT * FROM k where a = true ); ``` (documents.runAggregationQuery)
*
* @param string $parent Required. The parent resource name. In the format:
* `projects/{project_id}/databases/{database_id}/documents` or
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
* For example: `projects/my-project/databases/my-database/documents` or
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
* @param RunAggregationQueryRequest $postBody
* @param array $optParams Optional parameters.
* @return RunAggregationQueryResponse
* @throws \Google\Service\Exception
*/
public function runAggregationQuery($parent, RunAggregationQueryRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('runAggregationQuery', [$params], RunAggregationQueryResponse::class);
}
/**
* Runs a query. (documents.runQuery)
*
* @param string $parent Required. The parent resource name. In the format:
* `projects/{project_id}/databases/{database_id}/documents` or
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
* For example: `projects/my-project/databases/my-database/documents` or
* `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
* @param RunQueryRequest $postBody
* @param array $optParams Optional parameters.
* @return RunQueryResponse
* @throws \Google\Service\Exception
*/
public function runQuery($parent, RunQueryRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('runQuery', [$params], RunQueryResponse::class);
}
/**
* Streams batches of document updates and deletes, in order. This method is
* only available via gRPC or WebChannel (not REST). (documents.write)
*
* @param string $database Required. The database name. In the format:
* `projects/{project_id}/databases/{database_id}`. This is only required in the
* first message.
* @param WriteRequest $postBody
* @param array $optParams Optional parameters.
* @return WriteResponse
* @throws \Google\Service\Exception
*/
public function write($database, WriteRequest $postBody, $optParams = [])
{
$params = ['database' => $database, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('write', [$params], WriteResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsDatabasesDocuments::class, 'Google_Service_Firestore_Resource_ProjectsDatabasesDocuments');

View File

@@ -0,0 +1,121 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
use Google\Service\Firestore\FirestoreEmpty;
use Google\Service\Firestore\GoogleLongrunningCancelOperationRequest;
use Google\Service\Firestore\GoogleLongrunningListOperationsResponse;
use Google\Service\Firestore\GoogleLongrunningOperation;
/**
* The "operations" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $operations = $firestoreService->projects_databases_operations;
* </code>
*/
class ProjectsDatabasesOperations extends \Google\Service\Resource
{
/**
* Starts asynchronous cancellation on a long-running operation. The server
* makes a best effort to cancel the operation, but success is not guaranteed.
* If the server doesn't support this method, it returns
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
* other methods to check whether the cancellation succeeded or whether the
* operation completed despite cancellation. On successful cancellation, the
* operation is not deleted; instead, it becomes an operation with an
* Operation.error value with a google.rpc.Status.code of `1`, corresponding to
* `Code.CANCELLED`. (operations.cancel)
*
* @param string $name The name of the operation resource to be cancelled.
* @param GoogleLongrunningCancelOperationRequest $postBody
* @param array $optParams Optional parameters.
* @return FirestoreEmpty
* @throws \Google\Service\Exception
*/
public function cancel($name, GoogleLongrunningCancelOperationRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('cancel', [$params], FirestoreEmpty::class);
}
/**
* Deletes a long-running operation. This method indicates that the client is no
* longer interested in the operation result. It does not cancel the operation.
* If the server doesn't support this method, it returns
* `google.rpc.Code.UNIMPLEMENTED`. (operations.delete)
*
* @param string $name The name of the operation resource to be deleted.
* @param array $optParams Optional parameters.
* @return FirestoreEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], FirestoreEmpty::class);
}
/**
* Gets the latest state of a long-running operation. Clients can use this
* method to poll the operation result at intervals as recommended by the API
* service. (operations.get)
*
* @param string $name The name of the operation resource.
* @param array $optParams Optional parameters.
* @return GoogleLongrunningOperation
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GoogleLongrunningOperation::class);
}
/**
* Lists operations that match the specified filter in the request. If the
* server doesn't support this method, it returns `UNIMPLEMENTED`.
* (operations.listProjectsDatabasesOperations)
*
* @param string $name The name of the operation's parent resource.
* @param array $optParams Optional parameters.
*
* @opt_param string filter The standard list filter.
* @opt_param int pageSize The standard list page size.
* @opt_param string pageToken The standard list page token.
* @opt_param bool returnPartialSuccess When set to `true`, operations that are
* reachable are returned as normal, and those that are unreachable are returned
* in the ListOperationsResponse.unreachable field. This can only be `true` when
* reading across collections. For example, when `parent` is set to
* `"projects/example/locations/-"`. This field is not supported by default and
* will result in an `UNIMPLEMENTED` error if set unless explicitly documented
* otherwise in service or product specific documentation.
* @return GoogleLongrunningListOperationsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsDatabasesOperations($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], GoogleLongrunningListOperationsResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsDatabasesOperations::class, 'Google_Service_Firestore_Resource_ProjectsDatabasesOperations');

View File

@@ -0,0 +1,159 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
use Google\Service\Firestore\FirestoreEmpty;
use Google\Service\Firestore\GoogleFirestoreAdminV1DisableUserCredsRequest;
use Google\Service\Firestore\GoogleFirestoreAdminV1EnableUserCredsRequest;
use Google\Service\Firestore\GoogleFirestoreAdminV1ListUserCredsResponse;
use Google\Service\Firestore\GoogleFirestoreAdminV1ResetUserPasswordRequest;
use Google\Service\Firestore\GoogleFirestoreAdminV1UserCreds;
/**
* The "userCreds" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $userCreds = $firestoreService->projects_databases_userCreds;
* </code>
*/
class ProjectsDatabasesUserCreds extends \Google\Service\Resource
{
/**
* Create a user creds. (userCreds.create)
*
* @param string $parent Required. A parent name of the form
* `projects/{project_id}/databases/{database_id}`
* @param GoogleFirestoreAdminV1UserCreds $postBody
* @param array $optParams Optional parameters.
*
* @opt_param string userCredsId Required. The ID to use for the user creds,
* which will become the final component of the user creds's resource name. This
* value should be 4-63 characters. Valid characters are /a-z-/ with first
* character a letter and the last a letter or a number. Must not be UUID-like
* /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
* @return GoogleFirestoreAdminV1UserCreds
* @throws \Google\Service\Exception
*/
public function create($parent, GoogleFirestoreAdminV1UserCreds $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], GoogleFirestoreAdminV1UserCreds::class);
}
/**
* Deletes a user creds. (userCreds.delete)
*
* @param string $name Required. A name of the form
* `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
* @param array $optParams Optional parameters.
* @return FirestoreEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], FirestoreEmpty::class);
}
/**
* Disables a user creds. No-op if the user creds are already disabled.
* (userCreds.disable)
*
* @param string $name Required. A name of the form
* `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
* @param GoogleFirestoreAdminV1DisableUserCredsRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1UserCreds
* @throws \Google\Service\Exception
*/
public function disable($name, GoogleFirestoreAdminV1DisableUserCredsRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('disable', [$params], GoogleFirestoreAdminV1UserCreds::class);
}
/**
* Enables a user creds. No-op if the user creds are already enabled.
* (userCreds.enable)
*
* @param string $name Required. A name of the form
* `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
* @param GoogleFirestoreAdminV1EnableUserCredsRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1UserCreds
* @throws \Google\Service\Exception
*/
public function enable($name, GoogleFirestoreAdminV1EnableUserCredsRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('enable', [$params], GoogleFirestoreAdminV1UserCreds::class);
}
/**
* Gets a user creds resource. Note that the returned resource does not contain
* the secret value itself. (userCreds.get)
*
* @param string $name Required. A name of the form
* `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1UserCreds
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GoogleFirestoreAdminV1UserCreds::class);
}
/**
* List all user creds in the database. Note that the returned resource does not
* contain the secret value itself. (userCreds.listProjectsDatabasesUserCreds)
*
* @param string $parent Required. A parent database name of the form
* `projects/{project_id}/databases/{database_id}`
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1ListUserCredsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsDatabasesUserCreds($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], GoogleFirestoreAdminV1ListUserCredsResponse::class);
}
/**
* Resets the password of a user creds. (userCreds.resetPassword)
*
* @param string $name Required. A name of the form
* `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
* @param GoogleFirestoreAdminV1ResetUserPasswordRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1UserCreds
* @throws \Google\Service\Exception
*/
public function resetPassword($name, GoogleFirestoreAdminV1ResetUserPasswordRequest $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('resetPassword', [$params], GoogleFirestoreAdminV1UserCreds::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsDatabasesUserCreds::class, 'Google_Service_Firestore_Resource_ProjectsDatabasesUserCreds');

View File

@@ -0,0 +1,77 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
use Google\Service\Firestore\ListLocationsResponse;
use Google\Service\Firestore\Location;
/**
* The "locations" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $locations = $firestoreService->projects_locations;
* </code>
*/
class ProjectsLocations extends \Google\Service\Resource
{
/**
* Gets information about a location. (locations.get)
*
* @param string $name Resource name for the location.
* @param array $optParams Optional parameters.
* @return Location
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], Location::class);
}
/**
* Lists information about the supported locations for this service.
* (locations.listProjectsLocations)
*
* @param string $name The resource that owns the locations collection, if
* applicable.
* @param array $optParams Optional parameters.
*
* @opt_param string extraLocationTypes Optional. Do not use this field. It is
* unsupported and is ignored unless explicitly documented otherwise. This is
* primarily for internal usage.
* @opt_param string filter A filter to narrow down results to a preferred
* subset. The filtering language accepts strings like `"displayName=tokyo"`,
* and is documented in more detail in [AIP-160](https://google.aip.dev/160).
* @opt_param int pageSize The maximum number of results to return. If not set,
* the service selects a default.
* @opt_param string pageToken A page token received from the `next_page_token`
* field in the response. Send that page token to receive the subsequent page.
* @return ListLocationsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocations($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListLocationsResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocations::class, 'Google_Service_Firestore_Resource_ProjectsLocations');

View File

@@ -0,0 +1,92 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
namespace Google\Service\Firestore\Resource;
use Google\Service\Firestore\FirestoreEmpty;
use Google\Service\Firestore\GoogleFirestoreAdminV1Backup;
use Google\Service\Firestore\GoogleFirestoreAdminV1ListBackupsResponse;
/**
* The "backups" collection of methods.
* Typical usage is:
* <code>
* $firestoreService = new Google\Service\Firestore(...);
* $backups = $firestoreService->projects_locations_backups;
* </code>
*/
class ProjectsLocationsBackups extends \Google\Service\Resource
{
/**
* Deletes a backup. (backups.delete)
*
* @param string $name Required. Name of the backup to delete. format is
* `projects/{project}/locations/{location}/backups/{backup}`.
* @param array $optParams Optional parameters.
* @return FirestoreEmpty
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], FirestoreEmpty::class);
}
/**
* Gets information about a backup. (backups.get)
*
* @param string $name Required. Name of the backup to fetch. Format is
* `projects/{project}/locations/{location}/backups/{backup}`.
* @param array $optParams Optional parameters.
* @return GoogleFirestoreAdminV1Backup
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GoogleFirestoreAdminV1Backup::class);
}
/**
* Lists all the backups. (backups.listProjectsLocationsBackups)
*
* @param string $parent Required. The location to list backups from. Format is
* `projects/{project}/locations/{location}`. Use `{location} = '-'` to list
* backups from all locations for the given project. This allows listing backups
* from a single location or from all locations.
* @param array $optParams Optional parameters.
*
* @opt_param string filter An expression that filters the list of returned
* backups. A filter expression consists of a field name, a comparison operator,
* and a value for filtering. The value must be a string, a number, or a
* boolean. The comparison operator must be one of: `<`, `>`, `<=`, `>=`, `!=`,
* `=`, or `:`. Colon `:` is the contains operator. Filter rules are not case
* sensitive. The following fields in the Backup are eligible for filtering: *
* `database_uid` (supports `=` only)
* @return GoogleFirestoreAdminV1ListBackupsResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsBackups($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], GoogleFirestoreAdminV1ListBackupsResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsBackups::class, 'Google_Service_Firestore_Resource_ProjectsLocationsBackups');