OrganizationTeams() public static method

returns the Uri for org teams use for both Get and Create methods
public static OrganizationTeams ( string organization ) : Uri
organization string
return System.Uri
Exemplo n.º 1
0
        /// <summary>
        /// Returns all <see cref="Team" />s for the current org.
        /// </summary>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A list of the orgs's teams <see cref="Team"/>s.</returns>
        public Task <IReadOnlyList <Team> > GetAll(string org)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, "org");

            var endpoint = ApiUrls.OrganizationTeams(org);

            return(ApiConnection.GetAll <Team>(endpoint));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns newly created <see cref="Team" /> for the current org.
        /// </summary>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>Newly created <see cref="Team"/></returns>
        public Task <Team> Create(string org, NewTeam team)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, "org");
            Ensure.ArgumentNotNull(team, "team");

            var endpoint = ApiUrls.OrganizationTeams(org);

            return(ApiConnection.Post <Team>(endpoint, team));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns newly created <see cref="Team" /> for the current org.
        /// </summary>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>Newly created <see cref="Team"/></returns>
        public Task <Team> Create(string org, NewTeam team)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
            Ensure.ArgumentNotNull(team, nameof(team));

            var endpoint = ApiUrls.OrganizationTeams(org);

            return(ApiConnection.Post <Team>(endpoint, team, AcceptHeaders.NestedTeamsPreview));
        }
Exemplo n.º 4
0
        public Task <IReadOnlyList <Team> > GetAll(string org, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
            Ensure.ArgumentNotNull(options, nameof(options));

            var endpoint = ApiUrls.OrganizationTeams(org);

            return(ApiConnection.GetAll <Team>(endpoint, options));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Returns all <see cref="Team" />s for the current org.
        /// </summary>
        /// <param name="org">Organization to list teams of.</param>
        /// <param name="options">Options to change API behaviour.</param>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A list of the orgs's teams <see cref="Team"/>s.</returns>
        public Task <IReadOnlyList <Team> > GetAll(string org, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, "org");
            Ensure.ArgumentNotNull(options, "options");

            var endpoint = ApiUrls.OrganizationTeams(org);

            return(ApiConnection.GetAll <Team>(endpoint, null, AcceptHeaders.NestedTeamsPreview, options));
        }