Esempio n. 1
0
 public DimensionLevel(DimensionConfig dimconfig, int levelIndex)
 {
     typeOf          = DimensionType.Date;
     this.Config     = dimconfig;
     _level          = levelIndex;
     LevelDimensions = new List <DimensionLevel <T> >();
 }
        // private MemberDateTimeCollection<T> _members;

        public DimensionDateTime(DimensionConfig dimconfig, DateTimeLevels level, int levelIndex)
        {
            typeOf          = DimensionType.Date;
            this.Config     = dimconfig;
            DateLevel       = level;
            _level          = levelIndex;
            LevelDimensions = new List <DimensionDateTime <T> >();
        }
Esempio n. 3
0
 public Dimension(DimensionConfig dimconfig, IDataSource datasource) : this()
 {
     this.Config     = dimconfig;
     this.DataSource = datasource;
 }
Esempio n. 4
0
        /// <summary>
        /// Emits the usage event to the configured MARKETPLACEAPI_URI.
        /// </summary>
        private static async Task <HttpResponseMessage> EmitUsageEvents(IConfigurationRoot config, HttpClient httpClient, DimensionConfig dimensionConfig, BillingEntry billingEntry)
        {
            var usageEvent = new UsageEventDefinition
            {
                ResourceId         = billingEntry.resourceUsageId,
                Quantity           = dimensionConfig.Quantity,
                Dimension          = dimensionConfig.Dimension,
                EffectiveStartTime = DateTime.UtcNow,
                PlanId             = billingEntry.planId
            };

            if (CronJob.IsLocalRun(config))
            {
                return(new HttpResponseMessage
                {
                    Content = new StringContent(JsonConvert.SerializeObject(usageEvent), UnicodeEncoding.UTF8, "application/json"),
                    StatusCode = HttpStatusCode.OK
                });
            }

            return(await httpClient.PostAsJsonAsync(config["MARKETPLACEAPI_URI"], usageEvent).ConfigureAwait(continueOnCapturedContext: false));
        }
Esempio n. 5
0
 private void Awake()
 {
     instance = this;
 }
Esempio n. 6
0
 public DimensionBuilder()
 {
     _element = new DimensionConfig();
 }