public static CheckMemberPublic ( string org, string name ) : |
||
org | string | The organization being inquired about |
name | string | The user being inquired about |
Результат |
/// <summary> /// Check is a user is publicly a member of the organization. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/orgs/members/#check-public-membership">API documentation</a> /// for more information. /// </remarks> /// <param name="org">The login for the organization</param> /// <param name="user">The login for the user</param> /// <returns></returns> public async Task <bool> CheckMemberPublic(string org, string user) { Ensure.ArgumentNotNullOrEmptyString(org, "org"); Ensure.ArgumentNotNullOrEmptyString(user, "user"); try { var response = await Connection.Get <object>(ApiUrls.CheckMemberPublic(org, user), null, null).ConfigureAwait(false); return(response.HttpResponse.IsTrue()); } catch (NotFoundException) { return(false); } }
/// <summary> /// Check is a user is publicly a member of the organization. /// </summary> /// <remarks> /// See the <a href="http://developer.github.com/v3/orgs/members/#check-public-membership">API documentation</a> /// for more information. /// </remarks> /// <param name="org">The login for the organization</param> /// <param name="user">The login for the user</param> /// <returns></returns> public async Task <bool> CheckMemberPublic(string org, string user) { Ensure.ArgumentNotNullOrEmptyString(org, "org"); Ensure.ArgumentNotNullOrEmptyString(user, "user"); try { var response = await Connection.Get <object>(ApiUrls.CheckMemberPublic(org, user), null, null) .ConfigureAwait(false); if (response.StatusCode != HttpStatusCode.NotFound && response.StatusCode != HttpStatusCode.NoContent) { throw new ApiException("Invalid Status Code returned. Expected a 204 or a 404", response.StatusCode); } return(response.StatusCode == HttpStatusCode.NoContent); } catch (NotFoundException) { return(false); } }