Exemplo n.º 1
0
        public static ThroughputSettingsUpdateParameters CreateThroughputSettingsObject(int?throughput = null, int?autoscaleMaxThroughput = null)
        {
            Throughput             = throughput;
            AutoscaleMaxThroughput = autoscaleMaxThroughput;

            ThroughputHelper.ThroughputValidation(validateBothPresent: true);
            ThroughputSettingsUpdateParameters throughputSettingsUpdateParameters = new ThroughputSettingsUpdateParameters();

            if (throughput != null)
            {
                throughputSettingsUpdateParameters.Resource = new ThroughputSettingsResource
                {
                    Throughput = throughput.Value
                };
            }
            else if (autoscaleMaxThroughput != null)
            {
                throughputSettingsUpdateParameters.Resource = new ThroughputSettingsResource
                {
                    AutoscaleSettings = new AutoscaleSettingsResource {
                        MaxThroughput = autoscaleMaxThroughput.Value
                    }
                };
            }

            return(throughputSettingsUpdateParameters);
        }
Exemplo n.º 2
0
        public static CreateUpdateOptions PopulateCreateUpdateOptions(int?throughput = null, int?autoscaleMaxThroughput = null)
        {
            Throughput             = throughput;
            AutoscaleMaxThroughput = autoscaleMaxThroughput;
            ThroughputHelper.ThroughputValidation();

            CreateUpdateOptions createUpdateOptions = new CreateUpdateOptions();

            if (Throughput != null)
            {
                createUpdateOptions.Throughput = Throughput.Value;
            }
            else if (autoscaleMaxThroughput != null)
            {
                createUpdateOptions.AutoscaleSettings = new AutoscaleSettings {
                    MaxThroughput = AutoscaleMaxThroughput.Value
                };
            }

            return(createUpdateOptions);
        }