Esempio n. 1
0
        private const int ExpectedWorksheetCount = 19; //this includes two sheets from which we do not import: Header, Calculator

        #endregion

        #region Contructors

        public ImportValidator(IOptions <CharacterImporterOptions> characterImporterOptions, IOptions <RecordSphereImporterOptions> recordSphereImporterOptions,
                               IOptions <LegendSphereImporterOptions> legendSphereImporterOptions, IOptions <RecordMateriaImporterOptions> recordMateriaImporterOptions,
                               IOptions <LegendMateriaImporterOptions> legendMateriaImporterOptions, IOptions <AbilityImporterOptions> abilityImporterOptions,
                               IOptions <SoulBreakImporterOptions> soulBreakImporterOptions, IOptions <CommandImporterOptions> commandImporterOptions,
                               IOptions <BraveActionImporterOptions> braveActionImporterOptions,
                               IOptions <OtherImporterOptions> otherImporterOptions, IOptions <StatusImporterOptions> statusImporterOptions,
                               IOptions <RelicImporterOptions> relicImporterOptions, IOptions <MagiciteImporterOptions> magiciteImporterOptions,
                               IOptions <MagiciteSkillImporterOptions> magiciteSkillImporterOptions,
                               IOptions <EventImporterOptions> eventImporterOptions, IOptions <MissionImporterOptions> missionImporterOptions,
                               IOptions <ExperienceImporterOptions> experienceImporterOptions, IOptions <SheetsServiceOptions> sheetsServiceOptions,
                               IGoogleSheetsDataValidator googleSheetsDataValidator, ILogger <ImportValidator> logger)
        {
            _characterImporterOptions     = characterImporterOptions.Value;
            _recordSphereImporterOptions  = recordSphereImporterOptions.Value;
            _legendSphereImporterOptions  = legendSphereImporterOptions.Value;
            _recordMateriaImporterOptions = recordMateriaImporterOptions.Value;
            _legendMateriaImporterOptions = legendMateriaImporterOptions.Value;
            _abilityImporterOptions       = abilityImporterOptions.Value;
            _soulBreakImporterOptions     = soulBreakImporterOptions.Value;
            _commandImporterOptions       = commandImporterOptions.Value;
            _braveActionImporterOptions   = braveActionImporterOptions.Value;
            _otherImporterOptions         = otherImporterOptions.Value;
            _statusImporterOptions        = statusImporterOptions.Value;
            _relicImporterOptions         = relicImporterOptions.Value;
            _magiciteImporterOptions      = magiciteImporterOptions.Value;
            _magiciteSkillImporterOptions = magiciteSkillImporterOptions.Value;
            //_dungeonImporterOptions = dungeonImporterOptions.Value;
            _eventImporterOptions      = eventImporterOptions.Value;
            _missionImporterOptions    = missionImporterOptions.Value;
            _experienceImporterOptions = experienceImporterOptions.Value;
            _sheetsServiceOptions      = sheetsServiceOptions.Value;

            _googleSheetsDataValidator = googleSheetsDataValidator;
            _logger = logger;
        }
Esempio n. 2
0
        public SheetsApiHelper(IOptions <SheetsServiceOptions> sheetsServiceOptionsAccessor, ILogger <SheetsApiHelper> logger)
        {
            _logger = logger;
            _sheetsServiceOptions = sheetsServiceOptionsAccessor.Value;

            _sheetsService = new SheetsService(new BaseClientService.Initializer()
            {
                ApplicationName = _sheetsServiceOptions.Name,
                ApiKey          = _sheetsServiceOptions.ApiKey
            });

            _logger.LogInformation("SheetsService instance initialized for {ApplicationName}", _sheetsServiceOptions.Name);
        }