| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,46 +32,47 @@ option java_package = "com.google.datastore.v1beta3"; | |||
| 32 | 32 | // input keys sets the project ID (if not already set) to the project ID from | |
| 33 | 33 | // the request. | |
| 34 | 34 | // | |
| 35 | + // | ||
| 35 | 36 | service Datastore { | |
| 36 | - // Look up entities by key. | ||
| 37 | + // Looks up entities by key. | ||
| 37 | 38 | rpc Lookup(LookupRequest) returns (LookupResponse) { | |
| 38 | 39 | option (google.api.http) = { post: "/v1beta3/projects/{project_id}:lookup" body: "*" }; | |
| 39 | 40 | } | |
| 40 | 41 | ||
| 41 | - // Query for entities. | ||
| 42 | + // Queries for entities. | ||
| 42 | 43 | rpc RunQuery(RunQueryRequest) returns (RunQueryResponse) { | |
| 43 | 44 | option (google.api.http) = { post: "/v1beta3/projects/{project_id}:runQuery" body: "*" }; | |
| 44 | 45 | } | |
| 45 | 46 | ||
| 46 | - // Begin a new transaction. | ||
| 47 | + // Begins a new transaction. | ||
| 47 | 48 | rpc BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse) { | |
| 48 | 49 | option (google.api.http) = { post: "/v1beta3/projects/{project_id}:beginTransaction" body: "*" }; | |
| 49 | 50 | } | |
| 50 | 51 | ||
| 51 | - // Commit a transaction, optionally creating, deleting or modifying some | ||
| 52 | + // Commits a transaction, optionally creating, deleting or modifying some | ||
| 52 | 53 | // entities. | |
| 53 | 54 | rpc Commit(CommitRequest) returns (CommitResponse) { | |
| 54 | 55 | option (google.api.http) = { post: "/v1beta3/projects/{project_id}:commit" body: "*" }; | |
| 55 | 56 | } | |
| 56 | 57 | ||
| 57 | - // Roll back a transaction. | ||
| 58 | + // Rolls back a transaction. | ||
| 58 | 59 | rpc Rollback(RollbackRequest) returns (RollbackResponse) { | |
| 59 | 60 | option (google.api.http) = { post: "/v1beta3/projects/{project_id}:rollback" body: "*" }; | |
| 60 | 61 | } | |
| 61 | 62 | ||
| 62 | - // Allocate IDs for the given keys (useful for referencing an entity before | ||
| 63 | - // it is inserted). | ||
| 63 | + // Allocates IDs for the given keys, which is useful for referencing an entity | ||
| 64 | + // before it is inserted. | ||
| 64 | 65 | rpc AllocateIds(AllocateIdsRequest) returns (AllocateIdsResponse) { | |
| 65 | 66 | option (google.api.http) = { post: "/v1beta3/projects/{project_id}:allocateIds" body: "*" }; | |
| 66 | 67 | } | |
| 67 | 68 | } | |
| 68 | 69 | ||
| 69 | 70 | // The request for [google.datastore.v1beta3.Datastore.Lookup][google.datastore.v1beta3.Datastore.Lookup]. | |
| 70 | 71 | message LookupRequest { | |
| 71 | - // Project ID against which to make the request. | ||
| 72 | + // The ID of the project against which to make the request. | ||
| 72 | 73 | string project_id = 8; | |
| 73 | 74 | ||
| 74 | - // Options for this lookup request. | ||
| 75 | + // The options for this lookup request. | ||
| 75 | 76 | ReadOptions read_options = 1; | |
| 76 | 77 | ||
| 77 | 78 | // Keys of entities to look up. | |
@@ -98,7 +99,7 @@ message LookupResponse { | |||
| 98 | 99 | ||
| 99 | 100 | // The request for [google.datastore.v1beta3.Datastore.RunQuery][google.datastore.v1beta3.Datastore.RunQuery]. | |
| 100 | 101 | message RunQueryRequest { | |
| 101 | - // Project ID against which to make the request. | ||
| 102 | + // The ID of the project against which to make the request. | ||
| 102 | 103 | string project_id = 8; | |
| 103 | 104 | ||
| 104 | 105 | // Entities are partitioned into subsets, identified by a partition ID. | |
@@ -131,7 +132,7 @@ message RunQueryResponse { | |||
| 131 | 132 | ||
| 132 | 133 | // The request for [google.datastore.v1beta3.Datastore.BeginTransaction][google.datastore.v1beta3.Datastore.BeginTransaction]. | |
| 133 | 134 | message BeginTransactionRequest { | |
| 134 | - // Project ID against which to make the request. | ||
| 135 | + // The ID of the project against which to make the request. | ||
| 135 | 136 | string project_id = 8; | |
| 136 | 137 | } | |
| 137 | 138 | ||
@@ -143,7 +144,7 @@ message BeginTransactionResponse { | |||
| 143 | 144 | ||
| 144 | 145 | // The request for [google.datastore.v1beta3.Datastore.Rollback][google.datastore.v1beta3.Datastore.Rollback]. | |
| 145 | 146 | message RollbackRequest { | |
| 146 | - // Project ID against which to make the request. | ||
| 147 | + // The ID of the project against which to make the request. | ||
| 147 | 148 | string project_id = 8; | |
| 148 | 149 | ||
| 149 | 150 | // The transaction identifier, returned by a call to | |
@@ -159,27 +160,30 @@ message RollbackResponse { | |||
| 159 | 160 | ||
| 160 | 161 | // The request for [google.datastore.v1beta3.Datastore.Commit][google.datastore.v1beta3.Datastore.Commit]. | |
| 161 | 162 | message CommitRequest { | |
| 162 | - // Commit modes. | ||
| 163 | + // The modes available for commits. | ||
| 163 | 164 | enum Mode { | |
| 164 | - // Unspecified. | ||
| 165 | + // Unspecified. This value must not be used. | ||
| 165 | 166 | MODE_UNSPECIFIED = 0; | |
| 166 | 167 | ||
| 167 | - // Transactional. | ||
| 168 | + // Transactional: The mutations are either all applied, or none are applied. | ||
| 169 | + // Learn about transactions [here](https://cloud.google.com/datastore/docs/concepts/transactions). | ||
| 168 | 170 | TRANSACTIONAL = 1; | |
| 169 | 171 | ||
| 170 | - // Non-transactional. | ||
| 172 | + // Non-transactional: The mutations may not apply as all or none. | ||
| 171 | 173 | NON_TRANSACTIONAL = 2; | |
| 172 | 174 | } | |
| 173 | 175 | ||
| 174 | - // Project ID against which to make the request. | ||
| 176 | + // The ID of the project against which to make the request. | ||
| 175 | 177 | string project_id = 8; | |
| 176 | 178 | ||
| 177 | 179 | // The type of commit to perform. Defaults to `TRANSACTIONAL`. | |
| 178 | 180 | Mode mode = 5; | |
| 179 | 181 | ||
| 180 | 182 | // Must be set when mode is `TRANSACTIONAL`. | |
| 181 | 183 | oneof transaction_selector { | |
| 182 | - // The transaction in which to write. | ||
| 184 | + // The identifier of the transaction associated with the commit. A | ||
| 185 | + // transaction identifier is returned by a call to | ||
| 186 | + // [BeginTransaction][google.datastore.v1beta3.Datastore.BeginTransaction]. | ||
| 183 | 187 | bytes transaction = 1; | |
| 184 | 188 | } | |
| 185 | 189 | ||
@@ -188,6 +192,7 @@ message CommitRequest { | |||
| 188 | 192 | // When mode is `TRANSACTIONAL`, mutations affecting a single entity are | |
| 189 | 193 | // applied in order. The following sequences of mutations affecting a single | |
| 190 | 194 | // entity are not permitted in a single `Commit` request: | |
| 195 | + // | ||
| 191 | 196 | // - `insert` followed by `insert` | |
| 192 | 197 | // - `update` followed by `insert` | |
| 193 | 198 | // - `upsert` followed by `insert` | |
@@ -204,13 +209,14 @@ message CommitResponse { | |||
| 204 | 209 | // The i-th mutation result corresponds to the i-th mutation in the request. | |
| 205 | 210 | repeated MutationResult mutation_results = 3; | |
| 206 | 211 | ||
| 207 | - // The number of index entries updated during the commit. | ||
| 212 | + // The number of index entries updated during the commit, or zero if none were | ||
| 213 | + // updated. | ||
| 208 | 214 | int32 index_updates = 4; | |
| 209 | 215 | } | |
| 210 | 216 | ||
| 211 | 217 | // The request for [google.datastore.v1beta3.Datastore.AllocateIds][google.datastore.v1beta3.Datastore.AllocateIds]. | |
| 212 | 218 | message AllocateIdsRequest { | |
| 213 | - // Project ID against which to make the request. | ||
| 219 | + // The ID of the project against which to make the request. | ||
| 214 | 220 | string project_id = 8; | |
| 215 | 221 | ||
| 216 | 222 | // A list of keys with incomplete key paths for which to allocate IDs. | |
@@ -237,15 +243,15 @@ message Mutation { | |||
| 237 | 243 | // not even a value in an entity in another value. | |
| 238 | 244 | oneof operation { | |
| 239 | 245 | // The entity to insert. The entity must not already exist. | |
| 240 | - // The entity's key's final path element may be incomplete. | ||
| 246 | + // The entity key's final path element may be incomplete. | ||
| 241 | 247 | Entity insert = 4; | |
| 242 | 248 | ||
| 243 | 249 | // The entity to update. The entity must already exist. | |
| 244 | 250 | // Must have a complete key path. | |
| 245 | 251 | Entity update = 5; | |
| 246 | 252 | ||
| 247 | 253 | // The entity to upsert. The entity may or may not already exist. | |
| 248 | - // The entity's key's final path element may be incomplete. | ||
| 254 | + // The entity key's final path element may be incomplete. | ||
| 249 | 255 | Entity upsert = 6; | |
| 250 | 256 | ||
| 251 | 257 | // The key of the entity to delete. The entity may or may not already exist. | |
@@ -261,11 +267,11 @@ message MutationResult { | |||
| 261 | 267 | Key key = 3; | |
| 262 | 268 | } | |
| 263 | 269 | ||
| 264 | - // Options shared by read requests. | ||
| 270 | + // The options shared by read requests. | ||
| 265 | 271 | message ReadOptions { | |
| 266 | - // Read consistencies. | ||
| 272 | + // The possible values for read consistencies. | ||
| 267 | 273 | enum ReadConsistency { | |
| 268 | - // Unspecified. | ||
| 274 | + // Unspecified. This value must not be used. | ||
| 269 | 275 | READ_CONSISTENCY_UNSPECIFIED = 0; | |
| 270 | 276 | ||
| 271 | 277 | // Strong consistency. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,10 +31,12 @@ option java_package = "com.google.datastore.v1beta3"; | |||
| 31 | 31 | // | |
| 32 | 32 | // A partition ID contains several dimensions: | |
| 33 | 33 | // project ID and namespace ID. | |
| 34 | + // | ||
| 34 | 35 | // Partition dimensions: | |
| 35 | - // - A dimension may be `""`. | ||
| 36 | - // - A dimension must be valid UTF-8 bytes. | ||
| 37 | - // - A dimension's value must match regex `[A-Za-z\d\.\-_]{1,100}` | ||
| 36 | + // | ||
| 37 | + // - May be `""`. | ||
| 38 | + // - Must be valid UTF-8 bytes. | ||
| 39 | + // - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}` | ||
| 38 | 40 | // If the value of any dimension matches regex `__.*__`, the partition is | |
| 39 | 41 | // reserved/read-only. | |
| 40 | 42 | // A reserved/read-only partition ID is forbidden in certain documented | |
@@ -44,21 +46,21 @@ option java_package = "com.google.datastore.v1beta3"; | |||
| 44 | 46 | // not match the context project ID ) are discouraged. | |
| 45 | 47 | // Reads and writes of foreign partition IDs may fail if the project is not in an active state. | |
| 46 | 48 | message PartitionId { | |
| 47 | - // Project ID. | ||
| 49 | + // The ID of the project to which the entities belong. | ||
| 48 | 50 | string project_id = 2; | |
| 49 | 51 | ||
| 50 | - // Namespace ID. | ||
| 52 | + // If not empty, the ID of the namespace to which the entities belong. | ||
| 51 | 53 | string namespace_id = 4; | |
| 52 | 54 | } | |
| 53 | 55 | ||
| 54 | 56 | // A unique identifier for an entity. | |
| 55 | - // If a key's partition id or any of its path kinds or names are | ||
| 57 | + // If a key's partition ID or any of its path kinds or names are | ||
| 56 | 58 | // reserved/read-only, the key is reserved/read-only. | |
| 57 | 59 | // A reserved/read-only key is forbidden in certain documented contexts. | |
| 58 | 60 | message Key { | |
| 59 | 61 | // A (kind, ID/name) pair used to construct a key path. | |
| 60 | 62 | // | |
| 61 | - // If either name nor ID is set, the element is complete. | ||
| 63 | + // If either name or ID is set, the element is complete. | ||
| 62 | 64 | // If neither is set, the element is incomplete. | |
| 63 | 65 | message PathElement { | |
| 64 | 66 | // The kind of the entity. | |
@@ -67,9 +69,9 @@ message Key { | |||
| 67 | 69 | // Cannot be `""`. | |
| 68 | 70 | string kind = 1; | |
| 69 | 71 | ||
| 70 | - // The type of id. | ||
| 72 | + // The type of ID. | ||
| 71 | 73 | oneof id_type { | |
| 72 | - // The auto allocated ID of the entity. | ||
| 74 | + // The auto-allocated ID of the entity. | ||
| 73 | 75 | // Never equal to zero. Values less than zero are discouraged and may not | |
| 74 | 76 | // be supported in the future. | |
| 75 | 77 | int64 id = 2; | |
@@ -82,23 +84,27 @@ message Key { | |||
| 82 | 84 | } | |
| 83 | 85 | } | |
| 84 | 86 | ||
| 85 | - // Entities are partitioned into subsets, currently identified by a dataset | ||
| 86 | - // (usually implicitly specified by the project) and namespace ID. | ||
| 87 | + // Entities are partitioned into subsets, currently identified by a project | ||
| 88 | + // ID and namespace ID. | ||
| 87 | 89 | // Queries are scoped to a single partition. | |
| 88 | 90 | PartitionId partition_id = 1; | |
| 89 | 91 | ||
| 90 | 92 | // The entity path. | |
| 91 | 93 | // An entity path consists of one or more elements composed of a kind and a | |
| 92 | 94 | // string or numerical identifier, which identify entities. The first | |
| 93 | 95 | // element identifies a _root entity_, the second element identifies | |
| 94 | - // a _child_ of the root entity, the third element a child of the | ||
| 96 | + // a _child_ of the root entity, the third element identifies a child of the | ||
| 95 | 97 | // second entity, and so forth. The entities identified by all prefixes of | |
| 96 | 98 | // the path are called the element's _ancestors_. | |
| 99 | + // | ||
| 97 | 100 | // An entity path is always fully complete: *all* of the entity's ancestors | |
| 98 | 101 | // are required to be in the path along with the entity identifier itself. | |
| 99 | 102 | // The only exception is that in some documented cases, the identifier in the | |
| 100 | - // last path element (for the entity) itself may be omitted. A path can never | ||
| 101 | - // be empty. The path can have at most 100 elements. | ||
| 103 | + // last path element (for the entity) itself may be omitted. For example, | ||
| 104 | + // the last path element of the key of `Mutation.insert` may have no | ||
| 105 | + // identifier. | ||
| 106 | + // | ||
| 107 | + // A path can never be empty, and a path can have at most 100 elements. | ||
| 102 | 108 | repeated PathElement path = 2; | |
| 103 | 109 | } | |
| 104 | 110 | ||
@@ -136,10 +142,8 @@ message Value { | |||
| 136 | 142 | Key key_value = 5; | |
| 137 | 143 | ||
| 138 | 144 | // A UTF-8 encoded string value. | |
| 139 | - // When `exclude_from_indexes` is false (it is indexed) and meaning is not | ||
| 140 | - // 2, may have at most 1500 bytes. | ||
| 141 | - // When meaning is 2, may have at most 2083 bytes. | ||
| 142 | - // Otherwise, may be set to at least 1,000,000 bytes | ||
| 145 | + // When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes. | ||
| 146 | + // Otherwise, may be set to at least 1,000,000 bytes. | ||
| 143 | 147 | string string_value = 17; | |
| 144 | 148 | ||
| 145 | 149 | // A blob value. | |
@@ -152,9 +156,10 @@ message Value { | |||
| 152 | 156 | google.type.LatLng geo_point_value = 8; | |
| 153 | 157 | ||
| 154 | 158 | // An entity value. | |
| 155 | - // May have no key. | ||
| 156 | - // May have a key with an incomplete key path. | ||
| 157 | - // May have a reserved/read-only key. | ||
| 159 | + // | ||
| 160 | + // - May have no key. | ||
| 161 | + // - May have a key with an incomplete key path. | ||
| 162 | + // - May have a reserved/read-only key. | ||
| 158 | 163 | Entity entity_value = 6; | |
| 159 | 164 | ||
| 160 | 165 | // An array value. | |
@@ -172,7 +177,7 @@ message Value { | |||
| 172 | 177 | bool exclude_from_indexes = 19; | |
| 173 | 178 | } | |
| 174 | 179 | ||
| 175 | - // An entity. | ||
| 180 | + // A Datastore data object. | ||
| 176 | 181 | // | |
| 177 | 182 | // An entity is limited to 1 megabyte when stored. That _roughly_ | |
| 178 | 183 | // corresponds to a limit of 1 megabyte for the serialized form of this | |
@@ -182,7 +187,7 @@ message Entity { | |||
| 182 | 187 | // | |
| 183 | 188 | // An entity must have a key, unless otherwise documented (for example, | |
| 184 | 189 | // an entity in `Value.entity_value` may have no key). | |
| 185 | - // An entity's kind is its key's path's last element's kind, | ||
| 190 | + // An entity's kind is its key path's last element's kind, | ||
| 186 | 191 | // or null if it has no key. | |
| 187 | 192 | Key key = 1; | |
| 188 | 193 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments