-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incidents namespace new types, fields namespace improvements in Share…
…Point API
- Loading branch information
Showing
33 changed files
with
387 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
Demonstrates how to create lookup field | ||
""" | ||
from office365.sharepoint.client_context import ClientContext | ||
from tests import test_team_site_url, test_client_credentials, create_unique_name | ||
|
||
field_name = create_unique_name("MultilookupField") | ||
client = ClientContext(test_team_site_url).with_credentials(test_client_credentials) | ||
lookup_list = client.web.default_document_library() | ||
|
||
lookup_field = client.web.fields.add_lookup_field(title=field_name, | ||
lookup_list=lookup_list, | ||
lookup_field_name='Title', | ||
allow_multiple_values=True).execute_query() | ||
print(f"Field {lookup_field.internal_name} has been created") | ||
lookup_field.delete_object().execute_query() |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from office365.runtime.client_value import ClientValue | ||
|
||
|
||
class LicenseUnitsDetail(ClientValue): | ||
"""""" | ||
|
||
def __init__(self, enabled=None): | ||
""" | ||
:param int enabled: The number of units that are enabled for the active subscription of the service SKU. | ||
""" | ||
self.enabled = enabled |
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.entity import Entity | ||
|
||
|
||
class AuthenticationFlowsPolicy(Entity): | ||
""" | ||
Represents the policy configuration of self-service sign-up experience at a tenant level that lets external | ||
users request to sign up for approval. It contains information, such as the identifier, display name, and | ||
description, and indicates whether self-service sign-up is enabled for the policy. | ||
""" |
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,10 @@ | ||
from office365.entity import Entity | ||
|
||
|
||
class AuthenticationStrengthPolicy(Entity): | ||
""" | ||
A collection of settings that define specific combinations of authentication methods and metadata. | ||
The authentication strength policy, when applied to a given scenario using Azure AD Conditional Access, | ||
defines which authentication methods must be used to authenticate in that scenario. An authentication strength | ||
may be built-in or custom (defined by the tenant) and may or may not fulfill the requirements to grant an MFA claim. | ||
""" |
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
19 changes: 19 additions & 0 deletions
19
office365/directory/rolemanagement/unified_role_assignment.py
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,8 +1,27 @@ | ||
from office365.directory.rolemanagement.unified_role_definition import UnifiedRoleDefinition | ||
from office365.entity import Entity | ||
from office365.runtime.paths.resource_path import ResourcePath | ||
|
||
|
||
class UnifiedRoleAssignment(Entity): | ||
""" | ||
A role assignment is used to grant access to resources. It represents a role definition assigned to a principal | ||
(for example, a user or a role-assignable group) at a particular scope. | ||
""" | ||
|
||
@property | ||
def role_definition(self): | ||
""" | ||
The roleDefinition the assignment is for. Supports $expand. roleDefinition.Id will be auto expanded. | ||
""" | ||
return self.properties.get('roleDefinition', | ||
UnifiedRoleDefinition(self.context, | ||
ResourcePath("roleDefinition", self.resource_path))) | ||
|
||
def get_property(self, name, default_value=None): | ||
if default_value is None: | ||
property_mapping = { | ||
"roleDefinition": self.role_definition, | ||
} | ||
default_value = property_mapping.get(name, None) | ||
return super(UnifiedRoleAssignment, self).get_property(name, default_value) |
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.entity import Entity | ||
|
||
|
||
class SimulationAutomation(Entity): | ||
"""Represents simulation automation created to run on a tenant.""" |
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,6 +1,33 @@ | ||
from office365.directory.security.attacksimulations.automation import SimulationAutomation | ||
from office365.directory.security.attacksimulations.simulation import Simulation | ||
from office365.entity import Entity | ||
from office365.entity_collection import EntityCollection | ||
from office365.runtime.paths.resource_path import ResourcePath | ||
|
||
|
||
class AttackSimulationRoot(Entity): | ||
"""Represents an abstract type that provides the ability to launch a realistic phishing attack that organizations | ||
can learn from.""" | ||
|
||
@property | ||
def simulations(self): | ||
"""Represents an attack simulation training campaign in a tenant.""" | ||
return self.properties.get('simulations', | ||
EntityCollection(self.context, Simulation, | ||
ResourcePath("simulations", self.resource_path))) | ||
|
||
@property | ||
def simulation_automations(self): | ||
"""Represents simulation automation created to run on a tenant.""" | ||
return self.properties.get('simulationAutomations', | ||
EntityCollection(self.context, SimulationAutomation, | ||
ResourcePath("simulationAutomations", self.resource_path))) | ||
|
||
def get_property(self, name, default_value=None): | ||
if default_value is None: | ||
property_mapping = { | ||
"simulationAutomations": self.simulation_automations, | ||
} | ||
default_value = property_mapping.get(name, None) | ||
return super(AttackSimulationRoot, self).get_property(name, default_value) | ||
|
Oops, something went wrong.