Ejemplo n.º 1
0
        public void ModifyRequest()
        {
            EncryptionConfiguration config = new EncryptionConfiguration {
                KmsKeyName = "dataset_default_key"
            };
            var options = new CreateDatasetOptions
            {
                DefaultTableExpiration = TimeSpan.FromSeconds(10),
                Description            = "A description",
                FriendlyName           = "A friendly name",
                Location = "EU",
                DefaultEncryptionConfiguration = config,
                DefaultPartitionExpiration     = TimeSpan.FromSeconds(20)
            };
            Dataset dataset = new Dataset {
                Location = "US"
            };
            InsertRequest request = new InsertRequest(new BigqueryService(), dataset, "project");

            options.ModifyRequest(dataset, request);
            Assert.Equal(10 * 1000, dataset.DefaultTableExpirationMs);
            Assert.Equal("A description", dataset.Description);
            Assert.Equal("A friendly name", dataset.FriendlyName);
            Assert.Equal("EU", dataset.Location);
            Assert.Equal(20 * 1000, dataset.DefaultPartitionExpirationMs);
            Assert.Equal(config, dataset.DefaultEncryptionConfiguration);
        }
        public void ModifyRequest()
        {
            var           options = new CreateDatasetOptions();
            InsertRequest request = new InsertRequest(new BigqueryService(), new Dataset(), "project");

            options.ModifyRequest(request);
        }
        public void ModifyRequest()
        {
            var options = new CreateDatasetOptions
            {
                DefaultTableExpiration = TimeSpan.FromSeconds(10),
                Description            = "A description",
                FriendlyName           = "A friendly name"
            };
            Dataset       dataset = new Dataset();
            InsertRequest request = new InsertRequest(new BigqueryService(), dataset, "project");

            options.ModifyRequest(dataset, request);
            Assert.Equal(10 * 1000, dataset.DefaultTableExpirationMs);
            Assert.Equal("A description", dataset.Description);
            Assert.Equal("A friendly name", dataset.FriendlyName);
        }
Ejemplo n.º 4
0
        public void ModifyRequest_NoLocation()
        {
            // When the options don't specify a location, we should keep the one in the original Dataset.
            var options = new CreateDatasetOptions
            {
                DefaultTableExpiration = TimeSpan.FromSeconds(10),
                Description            = "A description",
                FriendlyName           = "A friendly name",
            };
            Dataset dataset = new Dataset {
                Location = "US"
            };
            InsertRequest request = new InsertRequest(new BigqueryService(), dataset, "project");

            options.ModifyRequest(dataset, request);
            Assert.Equal("US", dataset.Location);
        }