Esempio n. 1
0
 /// <summary>Snippet for SnapshotJob</summary>
 public void SnapshotJobRequestObject()
 {
     // Snippet: SnapshotJob(SnapshotJobRequest, CallSettings)
     // Create client
     JobsV1Beta3Client jobsV1Beta3Client = JobsV1Beta3Client.Create();
     // Initialize request argument(s)
     SnapshotJobRequest request = new SnapshotJobRequest
     {
         ProjectId       = "",
         JobId           = "",
         Ttl             = new Duration(),
         Location        = "",
         SnapshotSources = false,
         Description     = "",
     };
     // Make the request
     Snapshot response = jobsV1Beta3Client.SnapshotJob(request);
     // End snippet
 }
Esempio n. 2
0
        /// <summary>Snippet for SnapshotJobAsync</summary>
        public async Task SnapshotJobRequestObjectAsync()
        {
            // Snippet: SnapshotJobAsync(SnapshotJobRequest, CallSettings)
            // Additional: SnapshotJobAsync(SnapshotJobRequest, CancellationToken)
            // Create client
            JobsV1Beta3Client jobsV1Beta3Client = await JobsV1Beta3Client.CreateAsync();

            // Initialize request argument(s)
            SnapshotJobRequest request = new SnapshotJobRequest
            {
                ProjectId       = "",
                JobId           = "",
                Ttl             = new Duration(),
                Location        = "",
                SnapshotSources = false,
                Description     = "",
            };
            // Make the request
            Snapshot response = await jobsV1Beta3Client.SnapshotJobAsync(request);

            // End snippet
        }
Esempio n. 3
0
        public async stt::Task SnapshotJobRequestObjectAsync()
        {
            moq::Mock <JobsV1Beta3.JobsV1Beta3Client> mockGrpcClient = new moq::Mock <JobsV1Beta3.JobsV1Beta3Client>(moq::MockBehavior.Strict);
            SnapshotJobRequest request = new SnapshotJobRequest
            {
                ProjectId       = "project_id43ad98b0",
                JobId           = "job_id38ea97d6",
                Ttl             = new wkt::Duration(),
                Location        = "locatione09d18d5",
                SnapshotSources = false,
                Description     = "description2cf9da67",
            };
            Snapshot expectedResponse = new Snapshot
            {
                Id             = "id74b70bb8",
                ProjectId      = "project_id43ad98b0",
                SourceJobId    = "source_job_id1406915d",
                CreationTime   = new wkt::Timestamp(),
                Ttl            = new wkt::Duration(),
                State          = SnapshotState.UnknownSnapshotState,
                PubsubMetadata =
                {
                    new PubsubSnapshotMetadata(),
                },
                Description   = "description2cf9da67",
                DiskSizeBytes = -5516951742914183668L,
                Region        = "regionedb20d96",
            };

            mockGrpcClient.Setup(x => x.SnapshotJobAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Snapshot>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            JobsV1Beta3Client client = new JobsV1Beta3ClientImpl(mockGrpcClient.Object, null);
            Snapshot          responseCallSettings = await client.SnapshotJobAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Snapshot responseCancellationToken = await client.SnapshotJobAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>
 /// Snapshot the state of a streaming job.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override stt::Task <Snapshot> SnapshotJobAsync(SnapshotJobRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_SnapshotJobRequest(ref request, ref callSettings);
     return(_callSnapshotJob.Async(request, callSettings));
 }
 /// <summary>
 /// Snapshot the state of a streaming job.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public override Snapshot SnapshotJob(SnapshotJobRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_SnapshotJobRequest(ref request, ref callSettings);
     return(_callSnapshotJob.Sync(request, callSettings));
 }
 partial void Modify_SnapshotJobRequest(ref SnapshotJobRequest request, ref gaxgrpc::CallSettings settings);
 /// <summary>
 /// Snapshot the state of a streaming job.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <Snapshot> SnapshotJobAsync(SnapshotJobRequest request, st::CancellationToken cancellationToken) =>
 SnapshotJobAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Snapshot the state of a streaming job.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <Snapshot> SnapshotJobAsync(SnapshotJobRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();
 /// <summary>
 /// Snapshot the state of a streaming job.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public virtual Snapshot SnapshotJob(SnapshotJobRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();