TMDbLib/Client/TMDbClientLists.cs
/// <summary>
/// Deletes the specified list that is owned by the user
/// </summary>
/// <param name="listId">A list id that is owned by the user associated with the current session id</param>
/// <param name="cancellationToken">A cancellation token</param>
/// <remarks>Requires a valid user session</remarks>
/// <exception cref="UserSessionRequiredException">Thrown when the current client object doens't have a user session assigned.</exception>
Deletes the specified list that is owned by the user
Deletes the specified list that is owned by the user
public async Task<bool> ListDeleteAsync(string listId, CancellationToken cancellationToken = default)
        {
            RequireSessionId(SessionType.UserSession);
            if (string.IsNullOrWhiteSpace(listId))
                throw new ArgumentNullException(nameof(listId));
            RestRequest req = _client.Create("list/{listId}");
            req.AddUrlSegment("listId", listId);
            AddSessionId(req, SessionType.UserSession);
            RestResponse<PostReply> response = await req.Delete<PostReply>(cancellationToken).ConfigureAwait(false);
            PostReply item = await response.GetDataObject().ConfigureAwait(false);
            return item.StatusCode == 13;
        }
public async Task < bool > ListDeleteAsync ( string listId , CancellationToken cancellationToken = default ) { RequireSessionId ( SessionType . UserSession ) ; if ( string . IsNullOrWhiteSpace ( listId ) ) throw new ArgumentNullException ( nameof ( listId ) ) ; RestRequest req = _client . Create ( " " ) ; req . AddUrlSegment ( " " , listId ) ; AddSessionId ( req , SessionType . UserSession ) ; RestResponse < PostReply > response = await req . Delete < PostReply > ( cancellationToken ) . ConfigureAwait ( false ) ; PostReply item = await response . GetDataObject ( ) . ConfigureAwait ( false ) ; return item . StatusCode == 13 ; }
Deletes the specified list that is owned by the user
Deletes the specified list that is owned by the user
// Status code 13 = success // TODO: Previous code checked for item=null
Thrown when the current client object doens't have a user session assigned.
Thrown when the current client object doens ' t have a user session assigned .
listId
string
A list id that is owned by the user associated with the current session id
A list id that is owned by the user associated with the current session id
cancellationToken
CancellationToken
A cancellation token
A cancellation token
remarks
Requires a valid user session
Requires a valid user session