class ThreatAssessmentRequest
An abstract base class representing a threat assessment request item, inheriting from Entity. This class serves as a foundation for concrete threat assessment request implementations.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/protection/threatassessment/request.py
4 - 5
simple
Purpose
ThreatAssessmentRequest is an abstract resource type designed to model threat assessment requests in the Office365 API context. It extends the Entity base class to provide common functionality for threat assessment operations. This class is intended to be subclassed rather than instantiated directly, serving as a blueprint for specific types of threat assessment requests (e.g., email threats, URL threats, file threats). It provides the structural foundation for representing and managing threat assessment data within the Office365 security framework.
Source Code
class ThreatAssessmentRequest(Entity):
"""An abstract resource type used to represent a threat assessment request item."""
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
Entity | - |
Parameter Details
bases: Inherits from Entity class, which provides base functionality for Office365 entities including property management, serialization, and API interaction capabilities
Return Value
When instantiated (though typically through subclasses), returns a ThreatAssessmentRequest object that represents a threat assessment request entity. The object provides access to inherited Entity methods for property access, data binding, and API operations. Specific return values depend on methods inherited from the Entity base class.
Class Interface
Methods
__init__(context=None, **kwargs)
Purpose: Initializes a ThreatAssessmentRequest instance (inherited from Entity)
Parameters:
context: Optional Office365 client context for API operationskwargs: Additional keyword arguments passed to Entity base class for property initialization
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
entity_type_name |
str | The type name of the entity as recognized by Office365 API (inherited from Entity) | class |
properties |
dict | Dictionary storing entity properties and their values (inherited from Entity) | instance |
context |
ClientContext | The Office365 client context used for API operations (inherited from Entity) | instance |
Dependencies
office365
Required Imports
from office365.entity import Entity
from office365.entity_collection import ThreatAssessmentRequest
Usage Example
# Note: This is an abstract class, typically used through subclasses
# Example shows conceptual usage pattern
from office365.entity import Entity
from office365.security.threat_assessment_request import ThreatAssessmentRequest
# Typically accessed through Office365 client context
# from office365.runtime.auth.authentication_context import AuthenticationContext
# from office365.sharepoint.client_context import ClientContext
# Abstract class - would be instantiated through concrete subclass
# Example: EmailThreatAssessmentRequest, UrlThreatAssessmentRequest, etc.
# Conceptual usage through Office365 context:
# ctx = ClientContext(site_url).with_credentials(credentials)
# threat_request = ctx.security.threat_assessment_requests.get_by_id(request_id)
# threat_request.load()
# ctx.execute_query()
# print(threat_request.properties)
Best Practices
- Do not instantiate ThreatAssessmentRequest directly; use concrete subclasses specific to threat types (email, URL, file)
- Always use within an authenticated Office365 context with proper credentials
- Leverage inherited Entity methods for property access and data manipulation
- Follow Office365 API rate limits and throttling guidelines when making requests
- Ensure proper error handling for API calls and network operations
- Use the load() and execute_query() pattern from Office365 client context for lazy loading
- Check API permissions and ensure the application has necessary scopes for threat assessment operations
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class MailAssessmentRequest 76.0% similar
-
class Artifact 65.5% similar
-
class InformationProtection 64.9% similar
-
class Alert_v1 60.7% similar
-
class Incident 58.8% similar