/// <summary>Snippet for DeleteSchema</summary> public void DeleteSchemaRequestObject() { // Snippet: DeleteSchema(DeleteSchemaRequest, CallSettings) // Create client SchemaServiceClient schemaServiceClient = SchemaServiceClient.Create(); // Initialize request argument(s) DeleteSchemaRequest request = new DeleteSchemaRequest { SchemaName = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]"), }; // Make the request schemaServiceClient.DeleteSchema(request); // End snippet }
public void DeleteSchemaResourceNames() { moq::Mock <SchemaService.SchemaServiceClient> mockGrpcClient = new moq::Mock <SchemaService.SchemaServiceClient>(moq::MockBehavior.Strict); DeleteSchemaRequest request = new DeleteSchemaRequest { SchemaName = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteSchema(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); SchemaServiceClient client = new SchemaServiceClientImpl(mockGrpcClient.Object, null); client.DeleteSchema(request.SchemaName); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeleteSchemaAsync</summary> public async Task DeleteSchemaRequestObjectAsync() { // Snippet: DeleteSchemaAsync(DeleteSchemaRequest, CallSettings) // Additional: DeleteSchemaAsync(DeleteSchemaRequest, CancellationToken) // Create client SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync(); // Initialize request argument(s) DeleteSchemaRequest request = new DeleteSchemaRequest { SchemaName = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]"), }; // Make the request await schemaServiceClient.DeleteSchemaAsync(request); // End snippet }
public async stt::Task DeleteSchemaResourceNamesAsync() { moq::Mock <SchemaService.SchemaServiceClient> mockGrpcClient = new moq::Mock <SchemaService.SchemaServiceClient>(moq::MockBehavior.Strict); DeleteSchemaRequest request = new DeleteSchemaRequest { SchemaName = SchemaName.FromProjectSchema("[PROJECT]", "[SCHEMA]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteSchemaAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); SchemaServiceClient client = new SchemaServiceClientImpl(mockGrpcClient.Object, null); await client.DeleteSchemaAsync(request.SchemaName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeleteSchemaAsync(request.SchemaName, st::CancellationToken.None); mockGrpcClient.VerifyAll(); }