示例#1
0
        public async Task BeginTransactionAsync()
        {
            // Snippet: BeginTransactionAsync(string,CallSettings)
            // Additional: BeginTransactionAsync(string,CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            string projectId = "";
            // Make the request
            BeginTransactionResponse response = await datastoreClient.BeginTransactionAsync(projectId);

            // End snippet
        }
示例#2
0
        public async Task RollbackAsync()
        {
            // Snippet: RollbackAsync(string,ByteString,CallSettings)
            // Additional: RollbackAsync(string,ByteString,CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            string     projectId   = "";
            ByteString transaction = ByteString.CopyFromUtf8("");
            // Make the request
            RollbackResponse response = await datastoreClient.RollbackAsync(projectId, transaction);

            // End snippet
        }
示例#3
0
        public async Task AllocateIdsAsync()
        {
            // Snippet: AllocateIdsAsync(string,IEnumerable<Key>,CallSettings)
            // Additional: AllocateIdsAsync(string,IEnumerable<Key>,CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            string            projectId = "";
            IEnumerable <Key> keys      = new List <Key>();
            // Make the request
            AllocateIdsResponse response = await datastoreClient.AllocateIdsAsync(projectId, keys);

            // End snippet
        }
示例#4
0
        public async Task LookupAsync()
        {
            // Snippet: LookupAsync(string,ReadOptions,IEnumerable<Key>,CallSettings)
            // Additional: LookupAsync(string,ReadOptions,IEnumerable<Key>,CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            string            projectId   = "";
            ReadOptions       readOptions = new ReadOptions();
            IEnumerable <Key> keys        = new List <Key>();
            // Make the request
            LookupResponse response = await datastoreClient.LookupAsync(projectId, readOptions, keys);

            // End snippet
        }
示例#5
0
        public async Task BeginTransactionAsync_RequestObject()
        {
            // Snippet: BeginTransactionAsync(BeginTransactionRequest,CallSettings)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            BeginTransactionRequest request = new BeginTransactionRequest
            {
                ProjectId = "",
            };
            // Make the request
            BeginTransactionResponse response = await datastoreClient.BeginTransactionAsync(request);

            // End snippet
        }
        public async Task RunQueryAsync2()
        {
            // Snippet: RunQueryAsync(string,PartitionId,ReadOptions,GqlQuery,CallSettings)
            // Additional: RunQueryAsync(string,PartitionId,ReadOptions,GqlQuery,CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            string      projectId   = "";
            PartitionId partitionId = new PartitionId();
            ReadOptions readOptions = new ReadOptions();
            GqlQuery    gqlQuery    = new GqlQuery();
            // Make the request
            RunQueryResponse response = await datastoreClient.RunQueryAsync(projectId, partitionId, readOptions, gqlQuery);

            // End snippet
        }
示例#7
0
        public async Task AllocateIdsAsync_RequestObject()
        {
            // Snippet: AllocateIdsAsync(AllocateIdsRequest,CallSettings)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            AllocateIdsRequest request = new AllocateIdsRequest
            {
                ProjectId = "",
                Keys      = { },
            };
            // Make the request
            AllocateIdsResponse response = await datastoreClient.AllocateIdsAsync(request);

            // End snippet
        }
示例#8
0
        public async Task RollbackAsync_RequestObject()
        {
            // Snippet: RollbackAsync(RollbackRequest,CallSettings)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            RollbackRequest request = new RollbackRequest
            {
                ProjectId   = "",
                Transaction = ByteString.CopyFromUtf8(""),
            };
            // Make the request
            RollbackResponse response = await datastoreClient.RollbackAsync(request);

            // End snippet
        }
        public async Task LookupAsync_RequestObject()
        {
            // Snippet: LookupAsync(LookupRequest,CallSettings)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            LookupRequest request = new LookupRequest
            {
                ProjectId = "",
                Keys      = { },
            };
            // Make the request
            LookupResponse response = await datastoreClient.LookupAsync(request);

            // End snippet
        }
示例#10
0
        public async Task CommitAsync2()
        {
            // Snippet: CommitAsync(string,CommitRequest.Types.Mode,IEnumerable<Mutation>,CallSettings)
            // Additional: CommitAsync(string,CommitRequest.Types.Mode,IEnumerable<Mutation>,CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            string projectId = "";

            CommitRequest.Types.Mode mode      = CommitRequest.Types.Mode.Unspecified;
            IEnumerable <Mutation>   mutations = new List <Mutation>();
            // Make the request
            CommitResponse response = await datastoreClient.CommitAsync(projectId, mode, mutations);

            // End snippet
        }
        public async Task RunQueryAsync_RequestObject()
        {
            // Snippet: RunQueryAsync(RunQueryRequest,CallSettings)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            RunQueryRequest request = new RunQueryRequest
            {
                ProjectId   = "",
                PartitionId = new PartitionId(),
            };
            // Make the request
            RunQueryResponse response = await datastoreClient.RunQueryAsync(request);

            // End snippet
        }
        /// <summary>Snippet for ReserveIdsAsync</summary>
        public async Task ReserveIdsAsync_RequestObject()
        {
            // Snippet: ReserveIdsAsync(ReserveIdsRequest,CallSettings)
            // Additional: ReserveIdsAsync(ReserveIdsRequest,CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            ReserveIdsRequest request = new ReserveIdsRequest
            {
                ProjectId = "",
                Keys      = { },
            };
            // Make the request
            ReserveIdsResponse response = await datastoreClient.ReserveIdsAsync(request);

            // End snippet
        }
示例#13
0
        public async Task CommitAsync_RequestObject()
        {
            // Snippet: CommitAsync(CommitRequest,CallSettings)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            CommitRequest request = new CommitRequest
            {
                ProjectId = "",
                Mode      = CommitRequest.Types.Mode.Unspecified,
                Mutations = { },
            };
            // Make the request
            CommitResponse response = await datastoreClient.CommitAsync(request);

            // End snippet
        }
示例#14
0
        /// <summary>Snippet for RollbackAsync</summary>
        public async Task RollbackRequestObjectAsync()
        {
            // Snippet: RollbackAsync(RollbackRequest, CallSettings)
            // Additional: RollbackAsync(RollbackRequest, CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            RollbackRequest request = new RollbackRequest
            {
                Transaction = ByteString.Empty,
                ProjectId   = "",
            };
            // Make the request
            RollbackResponse response = await datastoreClient.RollbackAsync(request);

            // End snippet
        }
示例#15
0
        /// <summary>Snippet for AllocateIdsAsync</summary>
        public async Task AllocateIdsRequestObjectAsync()
        {
            // Snippet: AllocateIdsAsync(AllocateIdsRequest, CallSettings)
            // Additional: AllocateIdsAsync(AllocateIdsRequest, CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            AllocateIdsRequest request = new AllocateIdsRequest
            {
                Keys      = { new Key(), },
                ProjectId = "",
            };
            // Make the request
            AllocateIdsResponse response = await datastoreClient.AllocateIdsAsync(request);

            // End snippet
        }
示例#16
0
        /// <summary>Snippet for LookupAsync</summary>
        public async Task LookupRequestObjectAsync()
        {
            // Snippet: LookupAsync(LookupRequest, CallSettings)
            // Additional: LookupAsync(LookupRequest, CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            LookupRequest request = new LookupRequest
            {
                ReadOptions = new ReadOptions(),
                Keys        = { new Key(), },
                ProjectId   = "",
            };
            // Make the request
            LookupResponse response = await datastoreClient.LookupAsync(request);

            // End snippet
        }
示例#17
0
        /// <summary>Snippet for RunQueryAsync</summary>
        public async Task RunQueryRequestObjectAsync()
        {
            // Snippet: RunQueryAsync(RunQueryRequest, CallSettings)
            // Additional: RunQueryAsync(RunQueryRequest, CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            RunQueryRequest request = new RunQueryRequest
            {
                ReadOptions = new ReadOptions(),
                PartitionId = new PartitionId(),
                Query       = new Query(),
                ProjectId   = "",
            };
            // Make the request
            RunQueryResponse response = await datastoreClient.RunQueryAsync(request);

            // End snippet
        }
示例#18
0
        /// <summary>Snippet for CommitAsync</summary>
        public async Task CommitRequestObjectAsync()
        {
            // Snippet: CommitAsync(CommitRequest, CallSettings)
            // Additional: CommitAsync(CommitRequest, CancellationToken)
            // Create client
            DatastoreClient datastoreClient = await DatastoreClient.CreateAsync();

            // Initialize request argument(s)
            CommitRequest request = new CommitRequest
            {
                Transaction = ByteString.Empty,
                Mode        = CommitRequest.Types.Mode.Unspecified,
                Mutations   = { new Mutation(), },
                ProjectId   = "",
            };
            // Make the request
            CommitResponse response = await datastoreClient.CommitAsync(request);

            // End snippet
        }