コード例 #1
0
        public List <Section> GetSectionsBySchoolId(string schoolId)
        {
            IRestClient   client = EstablishApiClient();
            EnrollmentApi api    = new EnrollmentApi(client);
            IRestResponse <List <Section> > response = api.GetSectionsBySchool(schoolId, null, 100);

            return(response.Data);
        }
コード例 #2
0
        public List <School> GetSchools(int?offset, int?limit)
        {
            IRestClient   client = EstablishApiClient();
            EnrollmentApi api    = new EnrollmentApi(client);
            IRestResponse <List <School> > response = api.GetSchoolsAll(offset, limit);

            return(response.Data);
        }
コード例 #3
0
        public Instance AddModuleInstance(ModuleEnum module, InstanceConfiguration instanceConfiguration)
        {
            var additionalProperties = instanceConfiguration.GetHashtable();
            var config = new Config(
                apiKey: instanceConfiguration.ApiKey,
                host: instanceConfiguration.Host)
            {
                AutostartNotifications = instanceConfiguration.AutostartDaemon,
                ForceClear             = true,
                LogLevel = LogLevel.ALL,
            };

            var instance = new Instance {
                Id = Guid.NewGuid().ToString(), Module = module, CreatedAt = DateTime.Now
            };

            switch (module)
            {
            case ModuleEnum.AccountManagementApi:
                var accountApi = new AccountManagementApi(config);
                Instances.Add(instance, accountApi);
                break;

            case ModuleEnum.CertificatesApi:
                var certApi = new CertificatesApi(config);
                Instances.Add(instance, certApi);
                break;

            case ModuleEnum.ConnectApi:
                var connectApi = new ConnectApi(config);
                Instances.Add(instance, connectApi);
                break;

            case ModuleEnum.DeviceDirectoryApi:
                var deviceApi = new DeviceDirectoryApi(config);
                Instances.Add(instance, deviceApi);
                break;

            case ModuleEnum.StubAPI:
                var stubApi = new StubApi(config);
                Instances.Add(instance, stubApi);
                break;

            case ModuleEnum.UpdateApi:
                var updateApi = new UpdateApi(config);
                Instances.Add(instance, updateApi);
                break;

            case ModuleEnum.EnrollmentApi:
                var enrollmentApi = new EnrollmentApi(config);
                Instances.Add(instance, enrollmentApi);
                break;

            case ModuleEnum.BootstrapApi:
                var bootstrapApi = new BootstrapApi(config);
                Instances.Add(instance, bootstrapApi);
                break;

            case ModuleEnum.BillingApi:
                var billingApi = new BillingApi(config);
                Instances.Add(instance, billingApi);
                break;
            }

            return(instance);
        }
コード例 #4
0
        public void TestEnrollmentApi()
        {
            var enrollment = new EnrollmentApi(new Config("apiKey"));

            TestUserAgent(enrollment.Api.Configuration.UserAgent);
        }