示例#1
0
        public List <IbisPerson> Search(string query, bool approxMatches, bool includeCancelled, string misStatus,
                                        string attributes, int offset, int limit, string orderBy, string fetch)
        {
            string[]   pathParams  = { };
            object[]   queryParams = { "query",          query,
                                       "approxMatches",    approxMatches,
                                       "includeCancelled", includeCancelled,
                                       "misStatus",        misStatus,
                                       "attributes",       attributes,
                                       "offset",           offset,
                                       "limit",            limit,
                                       "orderBy",          orderBy,
                                       "fetch",            fetch };
            object[]   formParams = { };
            IbisResult result     = _ls.InvokeMethod("api/v1/person/search",
                                                     pathParams,
                                                     queryParams,
                                                     formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.ToString());
            }
            return(result.people);
        }
示例#2
0
        public List <IbisInstitution> GetInsts(string identifier, string fetch, string scheme = "crsid")
        {
            string[]   pathParams  = { scheme, identifier };
            object[]   queryParams = { "fetch", fetch };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/person/{0}/{1}/insts",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.message);
            }
            return(result.institutions);
        }
示例#3
0
        public List <IbisAttribute> GetAttributes(string identifier, string attrs, string scheme = "crsid")
        {
            string[]   pathParams  = { scheme, identifier };
            object[]   queryParams = { "attrs", attrs };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/person/{0}/{1}/get-attributes",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.message);
            }
            return(result.attributes);
        }
示例#4
0
        public bool IsMemberOfInst(string identifier, string instid, string scheme = "crsid")
        {
            string[]   pathParams  = { scheme, identifier, instid };
            object[]   queryParams = { };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/person/{0}/{1}/is-member-of-inst/{2}",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.message);
            }
            return(bool.Parse(result.value));
        }
示例#5
0
        public List <IbisPerson> GetMembers(string instid, string fetch)
        {
            string[]   pathParams  = { instid };
            object[]   queryParams = { "fetch", fetch };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/inst/{0}/members",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.ToString());
            }
            return(result.people);
        }
示例#6
0
        public IbisAttribute GetAttribute(string instid, long attrid)
        {
            string[]   pathParams  = { instid, "" + attrid };
            object[]   queryParams = { };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/inst/{0}/{1}",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.ToString());
            }
            return(result.attribute);
        }
示例#7
0
        public List <IbisGroup> GetGroups(string instid)
        {
            string[]   pathParams  = { instid };
            object[]   queryParams = { "fetch", "inst_groups" };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/inst/{0}",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.ToString());
            }
            return(result.institution.groups);
        }
示例#8
0
        public IbisInstitution GetInst(string instid, string fetch)
        {
            string[]   pathParams  = { instid };
            object[]   queryParams = { "fetch", fetch };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/inst/{0}",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.ToString());
            }
            return(result.institution);
        }
示例#9
0
        public List <IbisInstitution> AllInsts(bool includeCancelled, string fetch)
        {
            string[]   pathParams  = { };
            object[]   queryParams = { "includeCancelled", includeCancelled, "fetch", fetch };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/inst/all-insts",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.ToString());
            }
            return(result.institutions);
        }
示例#10
0
        public IbisGroup GetGroup(string groupid, string fetch)
        {
            string[]   pathParams  = { groupid };
            object[]   queryParams = { "fetch", fetch };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/group/{0}",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.ToString());
            }
            return(result.group);
        }
示例#11
0
        public byte[] GetPhotoBytes(string instid)
        {
            string[]   pathParams  = { instid };
            object[]   queryParams = { "attrs", "jpegPhoto" };
            object[]   formParams  = { };
            IbisResult result      = _ls.InvokeMethod("api/v1/inst/{0}/get-attributes",
                                                      pathParams,
                                                      queryParams,
                                                      formParams);

            if (result.error != null)
            {
                throw new Exception(result.error.ToString());
            }

            return(result.attribute.binaryData);
        }