Ejemplo n.º 1
0
 /// <summary>Snippet for ValidateSchema</summary>
 public void ValidateSchemaResourceNames()
 {
     // Snippet: ValidateSchema(ProjectName, Schema, CallSettings)
     // Create client
     SchemaServiceClient schemaServiceClient = SchemaServiceClient.Create();
     // Initialize request argument(s)
     ProjectName parent = ProjectName.FromProject("[PROJECT]");
     Schema      schema = new Schema();
     // Make the request
     ValidateSchemaResponse response = schemaServiceClient.ValidateSchema(parent, schema);
     // End snippet
 }
Ejemplo n.º 2
0
 /// <summary>Snippet for ValidateSchema</summary>
 public void ValidateSchema()
 {
     // Snippet: ValidateSchema(string, Schema, CallSettings)
     // Create client
     SchemaServiceClient schemaServiceClient = SchemaServiceClient.Create();
     // Initialize request argument(s)
     string parent = "projects/[PROJECT]";
     Schema schema = new Schema();
     // Make the request
     ValidateSchemaResponse response = schemaServiceClient.ValidateSchema(parent, schema);
     // End snippet
 }
Ejemplo n.º 3
0
        /// <summary>Snippet for ValidateSchemaAsync</summary>
        public async Task ValidateSchemaResourceNamesAsync()
        {
            // Snippet: ValidateSchemaAsync(ProjectName, Schema, CallSettings)
            // Additional: ValidateSchemaAsync(ProjectName, Schema, CancellationToken)
            // Create client
            SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync();

            // Initialize request argument(s)
            ProjectName parent = ProjectName.FromProject("[PROJECT]");
            Schema      schema = new Schema();
            // Make the request
            ValidateSchemaResponse response = await schemaServiceClient.ValidateSchemaAsync(parent, schema);

            // End snippet
        }
Ejemplo n.º 4
0
        /// <summary>Snippet for ValidateSchemaAsync</summary>
        public async Task ValidateSchemaAsync()
        {
            // Snippet: ValidateSchemaAsync(string, Schema, CallSettings)
            // Additional: ValidateSchemaAsync(string, Schema, CancellationToken)
            // Create client
            SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync();

            // Initialize request argument(s)
            string parent = "projects/[PROJECT]";
            Schema schema = new Schema();
            // Make the request
            ValidateSchemaResponse response = await schemaServiceClient.ValidateSchemaAsync(parent, schema);

            // End snippet
        }
Ejemplo n.º 5
0
 /// <summary>Snippet for ValidateSchema</summary>
 public void ValidateSchemaRequestObject()
 {
     // Snippet: ValidateSchema(ValidateSchemaRequest, CallSettings)
     // Create client
     SchemaServiceClient schemaServiceClient = SchemaServiceClient.Create();
     // Initialize request argument(s)
     ValidateSchemaRequest request = new ValidateSchemaRequest
     {
         ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
         Schema = new Schema(),
     };
     // Make the request
     ValidateSchemaResponse response = schemaServiceClient.ValidateSchema(request);
     // End snippet
 }
        public void ValidateSchemaResourceNames()
        {
            moq::Mock <SchemaService.SchemaServiceClient> mockGrpcClient = new moq::Mock <SchemaService.SchemaServiceClient>(moq::MockBehavior.Strict);
            ValidateSchemaRequest request = new ValidateSchemaRequest
            {
                ParentAsProjectName = gagr::ProjectName.FromProject("[PROJECT]"),
                Schema = new Schema(),
            };
            ValidateSchemaResponse expectedResponse = new ValidateSchemaResponse {
            };

            mockGrpcClient.Setup(x => x.ValidateSchema(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            SchemaServiceClient    client   = new SchemaServiceClientImpl(mockGrpcClient.Object, null);
            ValidateSchemaResponse response = client.ValidateSchema(request.ParentAsProjectName, request.Schema);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 7
0
        /// <summary>Snippet for ValidateSchemaAsync</summary>
        public async Task ValidateSchemaRequestObjectAsync()
        {
            // Snippet: ValidateSchemaAsync(ValidateSchemaRequest, CallSettings)
            // Additional: ValidateSchemaAsync(ValidateSchemaRequest, CancellationToken)
            // Create client
            SchemaServiceClient schemaServiceClient = await SchemaServiceClient.CreateAsync();

            // Initialize request argument(s)
            ValidateSchemaRequest request = new ValidateSchemaRequest
            {
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
                Schema = new Schema(),
            };
            // Make the request
            ValidateSchemaResponse response = await schemaServiceClient.ValidateSchemaAsync(request);

            // End snippet
        }
        public async stt::Task ValidateSchemaResourceNamesAsync()
        {
            moq::Mock <SchemaService.SchemaServiceClient> mockGrpcClient = new moq::Mock <SchemaService.SchemaServiceClient>(moq::MockBehavior.Strict);
            ValidateSchemaRequest request = new ValidateSchemaRequest
            {
                ParentAsProjectName = gagr::ProjectName.FromProject("[PROJECT]"),
                Schema = new Schema(),
            };
            ValidateSchemaResponse expectedResponse = new ValidateSchemaResponse {
            };

            mockGrpcClient.Setup(x => x.ValidateSchemaAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ValidateSchemaResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            SchemaServiceClient    client = new SchemaServiceClientImpl(mockGrpcClient.Object, null);
            ValidateSchemaResponse responseCallSettings = await client.ValidateSchemaAsync(request.ParentAsProjectName, request.Schema, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            ValidateSchemaResponse responseCancellationToken = await client.ValidateSchemaAsync(request.ParentAsProjectName, request.Schema, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }