This repository was archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 191
Expand file tree
/
Copy pathsubscription_request_builder.py
More file actions
70 lines (55 loc) · 2.5 KB
/
Copy pathsubscription_request_builder.py
File metadata and controls
70 lines (55 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -*- coding: utf-8 -*-
'''
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
'''
from __future__ import unicode_literals
from .subscription_request import SubscriptionRequest
from ..request_builder_base import RequestBuilderBase
class SubscriptionRequestBuilder(RequestBuilderBase):
def __init__(self, request_url, client):
"""Initialize the SubscriptionRequestBuilder
Args:
request_url (str): The url to perform the SubscriptionRequest
on
client (:class:`OneDriveClient<onedrivesdk.request.one_drive_client.OneDriveClient>`):
The client which will be used for the request
"""
super(SubscriptionRequestBuilder, self).__init__(request_url, client)
def request(self, expand=None, select=None, options=None):
"""Builds the SubscriptionRequest
Args:
expand (str): Default None, comma-seperated list of relationships
to expand in the response.
select (str): Default None, comma-seperated list of properties to
include in the response.
options (list of :class:`Option<onedrivesdk.options.Option>`):
A list of options to pass into the request. Defaults to None.
Returns:
:class:`SubscriptionRequest<onedrivesdk.request.subscription_request.SubscriptionRequest>`:
The SubscriptionRequest
"""
req = SubscriptionRequest(self._request_url, self._client, options)
req._set_query_options(expand=expand, select=select)
return req
def delete(self):
"""Deletes the specified Subscription."""
self.request().delete()
def get(self):
"""Gets the specified Subscription.
Returns:
:class:`Subscription<onedrivesdk.model.subscription.Subscription>`:
The Subscription.
"""
return self.request().get()
def update(self, subscription):
"""Updates the specified Subscription.
Args:
subscription (:class:`Subscription<onedrivesdk.model.subscription.Subscription>`):
The Subscription to update.
Returns:
:class:`Subscription<onedrivesdk.model.subscription.Subscription>`:
The updated Subscription
"""
return self.request().update(subscription)