-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
102 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
from office365.directory.synchronization.progress import SynchronizationProgress | ||
from office365.directory.synchronization.quarantine import SynchronizationQuarantine | ||
from office365.directory.synchronization.task_execution import SynchronizationTaskExecution | ||
from office365.runtime.client_value import ClientValue | ||
from office365.runtime.client_value_collection import ClientValueCollection | ||
|
||
|
||
class SynchronizationStatus(ClientValue): | ||
"""Represents the current status of the synchronizationJob.""" | ||
|
||
def __init__(self, progress=None, quarantine=SynchronizationQuarantine()): | ||
def __init__(self, progress=None, quarantine=SynchronizationQuarantine(), | ||
last_execution=SynchronizationTaskExecution(), | ||
last_successful_execution=SynchronizationTaskExecution(), | ||
last_successful_execution_with_exports=SynchronizationTaskExecution()): | ||
""" | ||
:param list[SynchronizationProgress] progress: Details of the progress of a job toward completion. | ||
:param SynchronizationQuarantine quarantine: | ||
""" | ||
self.progress = ClientValueCollection(SynchronizationProgress, progress) | ||
self.quarantine = quarantine | ||
self.lastExecution = last_execution | ||
self.lastSuccessfulExecution = last_successful_execution | ||
self.lastSuccessfulExecutionWithExports = last_successful_execution_with_exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from office365.runtime.client_value import ClientValue | ||
|
||
|
||
class SynchronizationTaskExecution(ClientValue): | ||
"""Summarizes the results of the synchronization job run.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from office365.sharepoint.changes.change import Change | ||
|
||
|
||
class ChangeAppConsentPrincipal(Change): | ||
"""""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,42 @@ | ||
from typing import Optional | ||
|
||
from requests import Response | ||
from typing_extensions import Self | ||
|
||
from office365.runtime.auth.authentication_context import AuthenticationContext | ||
from office365.runtime.auth.client_credential import ClientCredential | ||
from office365.runtime.auth.user_credential import UserCredential | ||
from office365.runtime.http.request_options import RequestOptions | ||
from office365.runtime.odata.request import ODataRequest | ||
from office365.runtime.odata.v3.json_light_format import JsonLightFormat | ||
|
||
|
||
class SharePointRequest(ODataRequest): | ||
def __init__(self): | ||
def __init__(self, base_url): | ||
super().__init__(JsonLightFormat()) | ||
self._auth_context = AuthenticationContext(url=base_url) | ||
self.beforeExecute += self._authenticate_request | ||
|
||
def execute_request(self, path): | ||
# type: (str) -> Response | ||
request_url = "{0}/_api/{1}".format(self._auth_context.url, path) | ||
return self.execute_request_direct(RequestOptions(request_url)) | ||
|
||
def with_credentials(self, credentials, environment="commercial"): | ||
# type: (UserCredential|ClientCredential, Optional[str]) -> Self | ||
""" | ||
Initializes a client to acquire a token via user or client credentials | ||
:type credentials: UserCredential or ClientCredential | ||
:param str environment: The Office 365 Cloud Environment endpoint used for authentication | ||
defaults to 'commercial'. | ||
""" | ||
self._auth_context.with_credentials( | ||
credentials, environment=environment | ||
) | ||
return self | ||
|
||
def _authenticate_request(self, request): | ||
# type: (RequestOptions) -> None | ||
"""Authenticate request""" | ||
self._auth_context.authenticate_request(request) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from office365.runtime.client_value import ClientValue | ||
|
||
|
||
class RecipientLimits(ClientValue): | ||
"""""" | ||
|
||
@property | ||
def entity_type_name(self): | ||
return "SP.Sharing.RecipientLimits" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters