Exemplo n.º 1
0
 /// <summary>
 /// Update <see cref="Role"/>'s.
 /// </summary>
 /// <remarks>
 /// This method requires authentication.
 /// See the <a href="http://sdldevelopmentpartners.sdlproducts.com/documentation/api">API documentation</a> for more information.
 /// </remarks>
 /// <exception cref="AuthorizationException">
 /// Thrown when the current user does not have permission to make the request.
 /// </exception>
 /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
 /// <returns>A list of <see cref="Role"/>s.</returns>
 public Task<string> Update(RoleRequest role)
 {
     return ApiConnection.Put<string>(ApiUrls.Roles(),role);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Update role <see cref="RoleRequest"/>s.
 /// </summary>
 /// <remarks>
 /// This method requires authentication.
 /// See the <a href="http://gs2017dev.sdl.com:41234/documentation/api/index#/">API documentation</a> for more information.
 /// </remarks>
 /// <exception cref="AuthorizationException">
 /// Thrown when the current user does not have permission to make the request.
 /// </exception>
 /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
 /// <returns>Role id</returns>
 public Task <string> Update(RoleRequest role)
 {
     return(ApiConnection.Put <string>(ApiUrls.Roles(), role));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Create <see cref="Role"/>'s.
        /// </summary>
        /// <remarks>
        /// This method requires authentication.
        /// See the <a href="http://sdldevelopmentpartners.sdlproducts.com/documentation/api">API documentation</a> for more information.
        /// </remarks>
        /// <exception cref="AuthorizationException">
        /// Thrown when the current user does not have permission to make the request.
        /// </exception>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>A list of <see cref="Role"/>s.</returns>
        public async Task<string> CreateRole(RoleRequest request)
        {
            Ensure.ArgumentNotNull(request, "request");

            return await ApiConnection.Post<string>(ApiUrls.Roles(), request, "application/json");
        }
Exemplo n.º 4
0
        /// <summary>
        /// Create <see cref="Role"/>s.
        /// </summary>
        /// <remarks>
        /// <param name="request"><see cref="RoleRequest"/></param>
        /// This method requires authentication.
        /// See the <a href="http://gs2017dev.sdl.com:41234/documentation/api/index#/">API documentation</a> for more information.
        /// </remarks>
        /// <exception cref="AuthorizationException">
        /// Thrown when the current user does not have permission to make the request.
        /// </exception>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        /// <returns>Role id.</returns>
        public async Task <string> CreateRole(RoleRequest request)
        {
            Ensure.ArgumentNotNull(request, "request");

            return(await ApiConnection.Post <string>(ApiUrls.Roles(), request, "application/json"));
        }