/// <summary> /// Begins a new transaction. /// Documentation https://developers.google.com/datastore/v1beta3/reference/projects/beginTransaction /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated datastore service.</param> /// <param name="projectId">The ID of the project against which to make the request.</param> /// <param name="body">A valid datastore v1beta3 body.</param> /// <returns>BeginTransactionResponseResponse</returns> public static BeginTransactionResponse BeginTransaction(datastoreService service, string projectId, BeginTransactionRequest body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (projectId == null) { throw new ArgumentNullException(projectId); } // Make the request. return(service.Projects.BeginTransaction(body, projectId).Execute()); } catch (Exception ex) { throw new Exception("Request Projects.BeginTransaction failed.", ex); } }
/// <summary> /// Allocate IDs for incomplete keys (useful for referencing an entity before it is inserted). /// Documentation https://developers.google.com/datastore/v1beta2/reference/datasets/allocateIds /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated datastore service.</param> /// <param name="datasetId">Identifies the dataset.</param> /// <param name="body">A valid datastore v1beta2 body.</param> /// <returns>AllocateIdsResponseResponse</returns> public static AllocateIdsResponse AllocateIds(datastoreService service, string datasetId, AllocateIdsRequest body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (datasetId == null) { throw new ArgumentNullException(datasetId); } // Make the request. return(service.Datasets.AllocateIds(body, datasetId).Execute()); } catch (Exception ex) { throw new Exception("Request Datasets.AllocateIds failed.", ex); } }