/// <summary>Snippet for Delete</summary> public void DeleteRequestObject() { // Snippet: Delete(DeleteGlobalAddressRequest, CallSettings) // Create client GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.Create(); // Initialize request argument(s) DeleteGlobalAddressRequest request = new DeleteGlobalAddressRequest { RequestId = "", Project = "", Address = "", }; // Make the request lro::Operation <Operation, Operation> response = globalAddressesClient.Delete(request); // Poll until the returned long-running operation is complete lro::Operation <Operation, Operation> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result Operation result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name lro::Operation <Operation, Operation> retrievedResponse = globalAddressesClient.PollOnceDelete(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Operation retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary> /// Deletes the specified address resource. /// </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 lro::Operation <Operation, Operation> Delete(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalAddressRequest(ref request, ref callSettings); Operation response = _callDelete.Sync(request, callSettings); GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); request.PopulatePollRequestFields(pollRequest); return(new lro::Operation <Operation, Operation>(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient)); }
/// <summary>Snippet for Delete</summary> public void DeleteRequestObject() { // Snippet: Delete(DeleteGlobalAddressRequest, CallSettings) // Create client GlobalAddressesClient globalAddressesClient = GlobalAddressesClient.Create(); // Initialize request argument(s) DeleteGlobalAddressRequest request = new DeleteGlobalAddressRequest { RequestId = "", Project = "", Address = "", }; // Make the request Operation response = globalAddressesClient.Delete(request); // End snippet }
public async stt::Task DeleteRequestObjectAsync() { moq::Mock <GlobalAddresses.GlobalAddressesClient> mockGrpcClient = new moq::Mock <GlobalAddresses.GlobalAddressesClient>(moq::MockBehavior.Strict); DeleteGlobalAddressRequest request = new DeleteGlobalAddressRequest { RequestId = "request_id362c8df6", Project = "projectaa6ff846", Address = "address04984d88", }; Operation expectedResponse = new Operation { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", User = "******", Zone = "zone255f4ea8", CreationTimestamp = "creation_timestamp235e59a1", StartTime = "start_timebd8dd9c4", OperationGroupId = "operation_group_idd2040cf0", TargetLink = "target_link9b435dc0", Progress = 278622268, Error = new Error(), EndTime = "end_time89285d30", Region = "regionedb20d96", OperationType = "operation_typeece9e153", Status = Operation.Types.Status.Pending, HttpErrorMessage = "http_error_messageb5ef3c7f", TargetId = 6263187990225347157UL, ClientOperationId = "client_operation_id4e51b631", StatusMessage = "status_message2c618f86", HttpErrorStatusCode = 1766362655, Description = "description2cf9da67", InsertTime = "insert_time7467185a", SelfLink = "self_link7e87f12d", Warnings = { new Warnings(), }, }; mockGrpcClient.Setup(x => x.DeleteAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Operation>(stt::Task.FromResult(expectedResponse), null, null, null, null)); GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); Operation responseCallSettings = await client.DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Operation responseCancellationToken = await client.DeleteAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeleteAsync</summary> public async Task DeleteRequestObjectAsync() { // Snippet: DeleteAsync(DeleteGlobalAddressRequest, CallSettings) // Additional: DeleteAsync(DeleteGlobalAddressRequest, CancellationToken) // Create client GlobalAddressesClient globalAddressesClient = await GlobalAddressesClient.CreateAsync(); // Initialize request argument(s) DeleteGlobalAddressRequest request = new DeleteGlobalAddressRequest { RequestId = "", Project = "", Address = "", }; // Make the request Operation response = await globalAddressesClient.DeleteAsync(request); // End snippet }
public void DeleteRequestObject() { moq::Mock <GlobalAddresses.GlobalAddressesClient> mockGrpcClient = new moq::Mock <GlobalAddresses.GlobalAddressesClient>(moq::MockBehavior.Strict); DeleteGlobalAddressRequest request = new DeleteGlobalAddressRequest { RequestId = "request_id362c8df6", Address = "address04984d88", Project = "projectaa6ff846", }; Operation expectedResponse = new Operation { Id = "id74b70bb8", Kind = "kindf7aa39d9", Name = "name1c9368b0", User = "******", Zone = "zone255f4ea8", ClientOperationId = "client_operation_id4e51b631", StatusMessage = "status_message2c618f86", CreationTimestamp = "creation_timestamp235e59a1", StartTime = "start_timebd8dd9c4", HttpErrorStatusCode = 1766362655, TargetLink = "target_link9b435dc0", Progress = 278622268, Error = new Error(), EndTime = "end_time89285d30", Region = "regionedb20d96", Description = "description2cf9da67", InsertTime = "insert_time7467185a", OperationType = "operation_typeece9e153", Status = Operation.Types.Status.Pending, SelfLink = "self_link7e87f12d", HttpErrorMessage = "http_error_messageb5ef3c7f", Warnings = { new Warnings(), }, TargetId = "target_id16dfe255", }; mockGrpcClient.Setup(x => x.Delete(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); GlobalAddressesClient client = new GlobalAddressesClientImpl(mockGrpcClient.Object, null); Operation response = client.Delete(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Deletes the specified address resource. /// </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 <Operation> DeleteAsync(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalAddressRequest(ref request, ref callSettings); return(_callDelete.Async(request, callSettings)); }
partial void Modify_DeleteGlobalAddressRequest(ref DeleteGlobalAddressRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Deletes the specified address resource. /// </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 <Operation> DeleteAsync(DeleteGlobalAddressRequest request, st::CancellationToken cancellationToken) => DeleteAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Deletes the specified address resource. /// </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 <Operation> DeleteAsync(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();
/// <summary> /// Deletes the specified address resource. /// </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 async stt::Task <lro::Operation <Operation, Operation> > DeleteAsync(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteGlobalAddressRequest(ref request, ref callSettings); Operation response = await _callDelete.Async(request, callSettings).ConfigureAwait(false); GetGlobalOperationRequest pollRequest = GetGlobalOperationRequest.FromInitialResponse(response); request.PopulatePollRequestFields(pollRequest); return(new lro::Operation <Operation, Operation>(response.ToLroResponse(pollRequest.ToLroOperationName()), DeleteOperationsClient)); }
/// <summary> /// Deletes the specified address resource. /// </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 lro::Operation <Operation, Operation> Delete(DeleteGlobalAddressRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();