Close httplib2 connections.
create(parent, body=None, documentId=None, x__xgafv=None)
Creates a Document.
Deletes a Document.
Gets a Document.
import_(parent, body=None, x__xgafv=None)
Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated.
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
Gets a list of Documents.
Retrieves the next page of results.
patch(name, allowMissing=None, body=None, x__xgafv=None)
Updates a Document.
close()
Close httplib2 connections.
create(parent, body=None, documentId=None, x__xgafv=None)
Creates a Document. Args: parent: string, Required. The parent resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. (required) body: object, The request body. The object takes the form of: { # Document captures all raw metadata information of items to be recommended or searched. "id": "A String", # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "jsonData": "A String", # The JSON string representation of the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "name": "A String", # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. "parentDocumentId": "A String", # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "schemaId": "A String", # Required. The identifier of the schema located in the same data store. "structData": { # The structured JSON data for the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "a_key": "", # Properties of the object. }, } documentId: string, Required. The ID to use for the Document, which will become the final component of the Document.name. If the caller does not have permission to create the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all Documents with the same parent. Otherwise, an ALREADY_EXISTS error is returned. This field must conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. Otherwise, an INVALID_ARGUMENT error is returned. x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # Document captures all raw metadata information of items to be recommended or searched. "id": "A String", # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "jsonData": "A String", # The JSON string representation of the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "name": "A String", # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. "parentDocumentId": "A String", # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "schemaId": "A String", # Required. The identifier of the schema located in the same data store. "structData": { # The structured JSON data for the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "a_key": "", # Properties of the object. }, }
delete(name, x__xgafv=None)
Deletes a Document. Args: name: string, Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to delete the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Document to delete does not exist, a NOT_FOUND error is returned. (required) x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } }
get(name, x__xgafv=None)
Gets a Document. Args: name: string, Required. Full resource name of Document, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to access the Document, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Document does not exist, a NOT_FOUND error is returned. (required) x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # Document captures all raw metadata information of items to be recommended or searched. "id": "A String", # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "jsonData": "A String", # The JSON string representation of the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "name": "A String", # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. "parentDocumentId": "A String", # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "schemaId": "A String", # Required. The identifier of the schema located in the same data store. "structData": { # The structured JSON data for the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "a_key": "", # Properties of the object. }, }
import_(parent, body=None, x__xgafv=None)
Bulk import of multiple Documents. Request processing may be synchronous. Non-existing items will be created. Note: It is possible for a subset of the Documents to be successfully updated. Args: parent: string, Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Requires create/update permission. (required) body: object, The request body. The object takes the form of: { # Request message for Import methods. "bigquerySource": { # BigQuery source import data from. # BigQuery input source. "dataSchema": "A String", # The schema to use when parsing the data from the source. Supported values for imports: * `user_event` (default): One JSON UserEvent per line. * `document` (default): One JSON Document per line. Each document must have a valid document.id. "datasetId": "A String", # Required. The BigQuery data set to copy the data from with a length limit of 1,024 characters. "gcsStagingDir": "A String", # Intermediate Cloud Storage directory used for the import with a length limit of 2,000 characters. Can be specified if one wants to have the BigQuery export to a specific Cloud Storage directory. "partitionDate": { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format. "day": 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. "month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. "year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. }, "projectId": "A String", # The project ID (can be project # or ID) that the BigQuery source is in with a length limit of 128 characters. If not specified, inherits the project ID from the parent request. "tableId": "A String", # Required. The BigQuery table to copy the data from with a length limit of 1,024 characters. }, "errorConfig": { # Configuration of destination for Import related errors. # The desired location of errors incurred during the Import. "gcsPrefix": "A String", # Cloud Storage prefix for import errors. This must be an empty, existing Cloud Storage directory. Import errors will be written to sharded files in this directory, one per line, as a JSON-encoded `google.rpc.Status` message. }, "gcsSource": { # Cloud Storage location for input content. # Cloud Storage location for the input content. "dataSchema": "A String", # The schema to use when parsing the data from the source. Supported values for imports: * `user_event` (default): One JSON UserEvent per line. * `document` (default): One JSON Document per line. Each document must have a valid Document.id. "inputUris": [ # Required. Cloud Storage URIs to input files. URI can be up to 2000 characters long. URIs can match the full object path (for example, `gs://bucket/directory/object.json`) or a pattern matching one or more files, such as `gs://bucket/directory/*.json`. A request can contain at most 100 files, and each file can be up to 2 GB. "A String", ], }, "inlineSource": { # The inline source for the input config for ImportDocuments method. # The Inline source for the input content for documents. "documents": [ # Required. A list of documents to update/create. Each document must have a valid Document.id. Recommended max of 100 items. { # Document captures all raw metadata information of items to be recommended or searched. "id": "A String", # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "jsonData": "A String", # The JSON string representation of the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "name": "A String", # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. "parentDocumentId": "A String", # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "schemaId": "A String", # Required. The identifier of the schema located in the same data store. "structData": { # The structured JSON data for the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "a_key": "", # Properties of the object. }, }, ], }, "reconciliationMode": "A String", # The mode of reconciliation between existing documents and the documents to be imported. Defaults to ReconciliationMode.INCREMENTAL. } x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # This resource represents a long-running operation that is the result of a network API call. "done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. "error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation. "code": 42, # The status code, which should be an enum value of google.rpc.Code. "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use. { "a_key": "", # Properties of the object. Contains field @type with type URL. }, ], "message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. }, "metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. "a_key": "", # Properties of the object. Contains field @type with type URL. }, "name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. "response": { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. "a_key": "", # Properties of the object. Contains field @type with type URL. }, }
list(parent, pageSize=None, pageToken=None, x__xgafv=None)
Gets a list of Documents. Args: parent: string, Required. The parent branch resource name, such as `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}`. Use `default_branch` as the branch ID, to list documents under the default branch. If the caller does not have permission to list Documentss under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned. (required) pageSize: integer, Maximum number of Documents to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an INVALID_ARGUMENT error is returned. pageToken: string, A page token ListDocumentsResponse.next_page_token, received from a previous DocumentService.ListDocuments call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to DocumentService.ListDocuments must match the call that provided the page token. Otherwise, an INVALID_ARGUMENT error is returned. x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # Response message for DocumentService.ListDocuments method. "documents": [ # The Documents. { # Document captures all raw metadata information of items to be recommended or searched. "id": "A String", # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "jsonData": "A String", # The JSON string representation of the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "name": "A String", # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. "parentDocumentId": "A String", # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "schemaId": "A String", # Required. The identifier of the schema located in the same data store. "structData": { # The structured JSON data for the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "a_key": "", # Properties of the object. }, }, ], "nextPageToken": "A String", # A token that can be sent as ListDocumentsRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. }
list_next()
Retrieves the next page of results. Args: previous_request: The request for the previous page. (required) previous_response: The response from the request for the previous page. (required) Returns: A request object that you can call 'execute()' on to request the next page. Returns None if there are no more items in the collection.
patch(name, allowMissing=None, body=None, x__xgafv=None)
Updates a Document. Args: name: string, Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. (required) body: object, The request body. The object takes the form of: { # Document captures all raw metadata information of items to be recommended or searched. "id": "A String", # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "jsonData": "A String", # The JSON string representation of the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "name": "A String", # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. "parentDocumentId": "A String", # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "schemaId": "A String", # Required. The identifier of the schema located in the same data store. "structData": { # The structured JSON data for the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "a_key": "", # Properties of the object. }, } allowMissing: boolean, If set to true, and the Document is not found, a new Document will be created. x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # Document captures all raw metadata information of items to be recommended or searched. "id": "A String", # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "jsonData": "A String", # The JSON string representation of the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "name": "A String", # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters. "parentDocumentId": "A String", # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters. "schemaId": "A String", # Required. The identifier of the schema located in the same data store. "structData": { # The structured JSON data for the document. It should conform to the registered schema or an INVALID_ARGUMENT error is thrown. "a_key": "", # Properties of the object. }, }