/// <summary>
        /// Moves the specified message to the trash.
        /// </summary>
        /// <param name="id">The ID of the message to Trash.</param>
        /// <returns></returns>
        public async Task <Message> TrashAsync(string id)
        {
            string queryString = new MessageQueryStringBuilder()
                                 .SetRequestAction(MessageRequestAction.Trash, id)
                                 .Build();

            return(await _proxy.Post <Message>(queryString));
        }
Exemple #2
0
        /// <summary>
        /// Modifies the labels applied to the thread. This applies to all messages in the thread.
        /// </summary>
        /// <param name="id">The ID of the thread to modify</param>
        /// <param name="input">The input to modify a thread</param>
        /// <returns></returns>
        public async Task <MessageThread> ModifyAsync(string id, ModifyThreadInput input)
        {
            string queryString = new ThreadQueryStringBuilder()
                                 .SetRequestAction(ThreadRequestAction.Modify, id)
                                 .Build();

            return(await _proxy.Post <MessageThread>(queryString, input));
        }
        /// <summary>
        /// Creates a new label.
        /// </summary>
        public async Task <Label> CreateAsync(CreateLabelInput labelInput)
        {
            string queryString = new LabelQueryStringBuilder()
                                 .Build();

            return(await _proxy.Post <Label>(queryString, labelInput));
        }
        /// <summary>
        /// Creates a new draft with the DRAFT label.
        /// </summary>
        public async Task <Draft> CreateAsync(Draft draftInput)
        {
            string queryString = new DraftQueryStringBuilder()
                                 .SetRequestAction(DraftRequestAction.Create)
                                 //.SetUploadType(UploadType.Media)//TODO:
                                 .Build();

            return(await _proxy.Post <Draft>(queryString, draftInput));
        }