Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit d32ff4c

Browse files
committed
Review feedback
1 parent e45f0d7 commit d32ff4c

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ can begin making calls using the SDK.
7474

7575
To interact with the OneDrive API, your app must authenticate for a specific resource. Your
7676
app must first use the Resource Discovery helper to find out which service you can access.
77-
Then, you can build a client to access those resources.
77+
Then, you can build a client to access those resources. This uses a slightly different
78+
auth flow than the standard code flow - note the use of `redeem_refresh_token` with
79+
the `service_resource_id` of the service you want to access.
7880

7981
```python
8082
import onedrivesdk

src/onedrivesdk/auth_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def scopes(self, value):
111111
@property
112112
def access_token(self):
113113
"""Gets and sets the access_token for the
114-
AuthProvider
114+
:class:`AuthProvider`
115115
116116
Returns:
117117
str: The access token. Looks at the session to figure out what the access token is, since this
@@ -124,7 +124,7 @@ class does not directly store the access token.
124124
@property
125125
def auth_server_url(self):
126126
"""Gets and sets the authorization server url for the
127-
AuthProvider
127+
:class:`AuthProvider`
128128
129129
Returns:
130130
str: Auth server url

src/onedrivesdk/extensions/onedrivesdk_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def get_business_client(client_id, scopes, base_url):
5050
scopes (list of str): The scopes required for your
5151
application
5252
base_url (str): Base URL of OneDrive for Business tenant.
53-
For example, "https://my-sharepoint.contoso.com/v1.0/"
53+
For example, "https://my-sharepoint.contoso.com/v1.0/"
5454
5555
Returns:
5656
:class:`OneDriveClient<onedrivesdk.requests.one_drive_client.OneDriveClient>`:

src/onedrivesdk/helpers/get_access_token_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_auth_token(auth_url, redirect_uri):
7575
class GetAccessTokenServer(HTTPServer, object):
7676

7777
def __init__(self, server_address, stop_event, RequestHandlerClass):
78-
HTTPServer.__init__(self, server_address, RequestHandlerClass)
78+
super(HTTPServer, self).init(server_address, RequestHandlerClass)
7979
self._stop_event = stop_event
8080
self._access_token = None
8181
self._authentication_token = None

src/onedrivesdk/helpers/resource_discovery.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ def get_service_info(self, access_token):
3030

3131

3232
class ServiceInfo(object):
33+
"""
34+
Objects representing ServiceInfo returned by the Discovery Service.
35+
More info can be found here:
36+
https://msdn.microsoft.com/en-us/office/office365/api/discovery-service-rest-operations
37+
"""
3338
def __init__(self, prop_dict={}):
3439
self._prop_dict = prop_dict
3540

@@ -48,6 +53,12 @@ def _prop_dict_set(self, prop, val):
4853

4954
@property
5055
def capability(self):
56+
"""
57+
58+
Returns:
59+
str: The Capability of the service
60+
61+
"""
5162
return self._prop_dict_get('capability')
5263

5364
@capability.setter
@@ -56,6 +67,12 @@ def capability(self, value):
5667

5768
@property
5869
def service_id(self):
70+
"""
71+
72+
Returns:
73+
str: The ServiceId
74+
75+
"""
5976
return self._prop_dict_get('serviceId')
6077

6178
@service_id.setter
@@ -64,6 +81,12 @@ def service_id(self, value):
6481

6582
@property
6683
def service_name(self):
84+
"""
85+
86+
Returns:
87+
str: The name of the service
88+
89+
"""
6790
return self._prop_dict_get('serviceName')
6891

6992
@service_name.setter
@@ -72,6 +95,13 @@ def service_name(self, value):
7295

7396
@property
7497
def service_endpoint_uri(self):
98+
"""
99+
100+
Returns:
101+
str: The serviceEndpointUri
102+
Ex: https://contoso-my.sharepoint.com/personal/alexd_contoso_com
103+
104+
"""
75105
return self._prop_dict_get('serviceEndpointUri')
76106

77107
@service_endpoint_uri.setter
@@ -80,6 +110,13 @@ def service_endpoint_uri(self, value):
80110

81111
@property
82112
def service_resource_id(self):
113+
"""
114+
115+
Returns:
116+
str: the serviceResourceId
117+
Ex: https://contoso-my.sharepoint.com/
118+
119+
"""
83120
return self._prop_dict_get('serviceResourceId')
84121

85122
@service_resource_id.setter
@@ -88,6 +125,12 @@ def service_resource_id(self, value):
88125

89126
@property
90127
def service_api_version(self):
128+
"""
129+
130+
Returns:
131+
str: the serviceApiVersion
132+
133+
"""
91134
return self._prop_dict_get('serviceApiVersion')
92135

93136
@service_api_version.setter

0 commit comments

Comments
 (0)