コード例 #1
0
        public async Task <SteamUser> GetUserInfo(long steamId64)
        {
            var r = await httpServices.Get(string.Format(Const.STEAMDB_USERINFO_URL, steamId64));

            var userInfo = JsonConvert.DeserializeObject <SteamUser>(r);

            return(userInfo);
        }
コード例 #2
0
        public async Task <ClientDetailsResponse> GetDetailsClientById(long id)
        {
            string uri = "api/client/GetDetailsClientById/" + id;

            var clientInDb = await httpServices.Get <ClientDetailsResponse>(uri);

            if (clientInDb == null)
            {
                throw new Exception("Not found Clients");
            }

            return(clientInDb);
        }
コード例 #3
0
        public async Task <List <PermissionDto> > GetAllPermission()
        {
            string uri = "api/permission/PermissionList";

            var permissionListInDB = await httpServices.Get <List <PermissionDto> >(uri);

            if (permissionListInDB == null)
            {
                throw new Exception("The permission list not founded!");
            }

            return(permissionListInDB);
        }
コード例 #4
0
        public async Task <SteamUser> GetUserInfo(long steamId64)
        {
            var r = await httpServices.Get(string.Format(Const.STEAMDB_USERINFO_URL, steamId64));

            if (!string.IsNullOrEmpty(r))
            {
                var userInfo = JsonConvert.DeserializeObject <SteamUser>(r);
                return(userInfo);
            }
            return(new SteamUser()
            {
                SteamId64 = steamId64
            });
        }
コード例 #5
0
        /// <summary>
        /// CreatedOn            :
        /// Document Url         :
        /// Api Url              :      GET https://vssps.dev.azure.com/{organization}/_apis/graph/descriptors/{storageKey}?api-version=5.0-preview.1
        /// Discription          :
        /// Current Version      :
        /// BasicTest Executed   :      NO
        /// </summary>
        /// <returns></returns>
        public ApiResponseMsg GetDescriptors(string organizationName, string projectId)
        {
            HttpConfigurations oAppConfigurations = new HttpConfigurations();

            oAppConfigurations.BaseUrl   = _baseUrl;
            oAppConfigurations.UrlParams = string.Format("{0}/_apis/graph/descriptors/{1}?api-version=5.0-preview.1", organizationName, projectId);

            oAppConfigurations.SecurityKey          = _token;
            oAppConfigurations.ContentType          = Helpers.Constants.ContentTypeJson;
            oAppConfigurations.HttpMethod           = Constants.Get;
            oAppConfigurations.AuthenticationScheme = AuthConfig.AuthType;
            HttpServices oHttpService = new HttpServices(oAppConfigurations);

            return(oHttpService.Get());
        }
コード例 #6
0
        /// <summary>
        /// CreatedOn            :
        /// Document Url         :      https://docs.microsoft.com/en-us/rest/api/azure/devops/memberentitlementmanagement/members/get?view=azure-devops-rest-5.0
        /// Api Url              :      GET https://vsaex.dev.azure.com/{organization}/_apis/GroupEntitlements/{groupId}/members?api-version=5.0-preview.1
        /// Discription          :
        /// Current Version      :
        /// BasicTest Executed   :      NO
        /// </summary>
        /// <returns></returns>
        public ApiResponseMsg GetMenbersForGroup(string organizationName, string groupId)
        {
            HttpConfigurations oAppConfigurations = new HttpConfigurations();

            oAppConfigurations.BaseUrl   = _baseUrl;
            oAppConfigurations.UrlParams = string.Format("{0}/_apis/GroupEntitlements/{1}/members?api-version=5.0-preview.1", organizationName, groupId);

            oAppConfigurations.SecurityKey          = _token;
            oAppConfigurations.ContentType          = Constants.ContentTypeJson;
            oAppConfigurations.HttpMethod           = Constants.Get;
            oAppConfigurations.AuthenticationScheme = AuthConfig.AuthType;
            HttpServices oHttpService = new HttpServices(oAppConfigurations);

            return(oHttpService.Get());
        }
コード例 #7
0
        /// <summary>
        /// CreatedOn            :
        /// Document Url         :     https://docs.microsoft.com/en-us/rest/api/azure/devops/graph/groups/list?view=azure-devops-rest-5.0
        /// Api Url              :      GET https://vssps.dev.azure.com/{organization}/_apis/graph/groups/{groupDescriptor}?api-version=5.0-preview.1
        /// Discription          :
        /// Current Version      :
        /// BasicTest Executed   :      NO
        /// </summary>
        /// <returns></returns>

        public ApiResponseMsg GetGroups(string organizationName, string scopeDescriptor = "")
        {
            HttpConfigurations oAppConfigurations = new HttpConfigurations();

            oAppConfigurations.BaseUrl = _baseUrl;
            if (string.IsNullOrEmpty(scopeDescriptor))
            {
                oAppConfigurations.UrlParams = string.Format("{0}/_apis/graph/groups?api-version=5.0-preview.1", organizationName);
            }
            else
            {
                oAppConfigurations.UrlParams = string.Format("{0}/_apis/graph/groups?scopeDescriptor={1}&api-version=5.0-preview.1", organizationName, scopeDescriptor);
            }
            oAppConfigurations.SecurityKey          = _token;
            oAppConfigurations.ContentType          = Constants.ContentTypeJson;
            oAppConfigurations.HttpMethod           = Constants.Get;
            oAppConfigurations.AuthenticationScheme = Constants.SchemeOAuth;
            HttpServices oHttpService = new HttpServices(oAppConfigurations);

            return(oHttpService.Get());
        }