Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding outlook mail messages update functionality, which was not there #906

Closed
wants to merge 8 commits into from
17 changes: 17 additions & 0 deletions office365/outlook/mail/messages/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from office365.outlook.mail.recipient import Recipient
from office365.runtime.client_result import ClientResult
from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.http.http_method import HttpMethod
from office365.runtime.paths.resource_path import ResourcePath
from office365.runtime.queries.function import FunctionQuery
from office365.runtime.queries.service_operation import ServiceOperationQuery
Expand Down Expand Up @@ -123,6 +124,22 @@ def _message_loaded():
os.path.basename(file_object.name), content.decode("utf-8")
)
return self

def update(self, payload):
"""
Update the properties of a message. Only the properties that are set in the request body will be updated.

:param dict payload: A JSON object that contains the properties and values for the message.
"""
def _construct_request(request):
request.method = HttpMethod.Patch



qry = ServiceOperationQuery(self, None, None, payload)
self.context.add_query(qry).before_execute(_construct_request)

return self

def send(self):
"""
Expand Down
Loading