/// <summary>Snippet for DeleteAutoscalingPolicy</summary> public void DeleteAutoscalingPolicy_RequestObject() { // Snippet: DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest,CallSettings) // Create client AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); // Initialize request argument(s) DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest { Name = new AutoscalingPolicyName("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]").ToString(), }; // Make the request autoscalingPolicyServiceClient.DeleteAutoscalingPolicy(request); // End snippet }
/// <summary>Snippet for DeleteAutoscalingPolicy</summary> public void DeleteAutoscalingPolicyRequestObject() { // Snippet: DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest, CallSettings) // Create client AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); // Initialize request argument(s) DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest { AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), }; // Make the request autoscalingPolicyServiceClient.DeleteAutoscalingPolicy(request); // End snippet }
public void DeleteAutoscalingPolicyResourceNames() { moq::Mock <AutoscalingPolicyService.AutoscalingPolicyServiceClient> mockGrpcClient = new moq::Mock <AutoscalingPolicyService.AutoscalingPolicyServiceClient>(moq::MockBehavior.Strict); DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest { AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteAutoscalingPolicy(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); client.DeleteAutoscalingPolicy(request.AutoscalingPolicyName); mockGrpcClient.VerifyAll(); }
public async Task DeleteAutoscalingPolicyAsync2() { Mock <AutoscalingPolicyService.AutoscalingPolicyServiceClient> mockGrpcClient = new Mock <AutoscalingPolicyService.AutoscalingPolicyServiceClient>(MockBehavior.Strict); DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest { Name = new AutoscalingPolicyName("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]").ToString(), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteAutoscalingPolicyAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <Empty>(Task.FromResult(expectedResponse), null, null, null, null)); AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); await client.DeleteAutoscalingPolicyAsync(request); mockGrpcClient.VerifyAll(); }
public void DeleteAutoscalingPolicy2() { Mock <AutoscalingPolicyService.AutoscalingPolicyServiceClient> mockGrpcClient = new Mock <AutoscalingPolicyService.AutoscalingPolicyServiceClient>(MockBehavior.Strict); DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest { Name = new AutoscalingPolicyName("[PROJECT]", "[REGION]", "[AUTOSCALING_POLICY]").ToString(), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteAutoscalingPolicy(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); client.DeleteAutoscalingPolicy(request); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeleteAutoscalingPolicyAsync</summary> public async Task DeleteAutoscalingPolicyRequestObjectAsync() { // Snippet: DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest, CallSettings) // Additional: DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest, CancellationToken) // Create client AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); // Initialize request argument(s) DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest { AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), }; // Make the request await autoscalingPolicyServiceClient.DeleteAutoscalingPolicyAsync(request); // End snippet }
public async stt::Task DeleteAutoscalingPolicyResourceNamesAsync() { moq::Mock <AutoscalingPolicyService.AutoscalingPolicyServiceClient> mockGrpcClient = new moq::Mock <AutoscalingPolicyService.AutoscalingPolicyServiceClient>(moq::MockBehavior.Strict); DeleteAutoscalingPolicyRequest request = new DeleteAutoscalingPolicyRequest { AutoscalingPolicyName = AutoscalingPolicyName.FromProjectLocationAutoscalingPolicy("[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteAutoscalingPolicyAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AutoscalingPolicyServiceClient client = new AutoscalingPolicyServiceClientImpl(mockGrpcClient.Object, null); await client.DeleteAutoscalingPolicyAsync(request.AutoscalingPolicyName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteAutoscalingPolicyAsync(request.AutoscalingPolicyName, st::CancellationToken.None); mockGrpcClient.VerifyAll(); }
/// <summary> /// Deletes an autoscaling policy. It is an error to delete an autoscaling /// policy that is in use by one or more clusters. /// </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 DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteAutoscalingPolicyRequest(ref request, ref callSettings); return(_callDeleteAutoscalingPolicy.Async(request, callSettings)); }
/// <summary> /// Deletes an autoscaling policy. It is an error to delete an autoscaling /// policy that is in use by one or more clusters. /// </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 void DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_DeleteAutoscalingPolicyRequest(ref request, ref callSettings); _callDeleteAutoscalingPolicy.Sync(request, callSettings); }
partial void Modify_DeleteAutoscalingPolicyRequest(ref DeleteAutoscalingPolicyRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Deletes an autoscaling policy. It is an error to delete an autoscaling /// policy that is in use by one or more clusters. /// </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 DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest request, st::CancellationToken cancellationToken) => DeleteAutoscalingPolicyAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Deletes an autoscaling policy. It is an error to delete an autoscaling /// policy that is in use by one or more clusters. /// </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 DeleteAutoscalingPolicyAsync(DeleteAutoscalingPolicyRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();