class TenantAppInformation
A data class that represents information about a tenant-scoped application in Office 365, including its principal ID, web URL, and creation timestamp.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/apps/information.py
4 - 17
simple
Purpose
This class serves as a data container (value object) for tenant-scoped app information in Office 365 environments. It inherits from ClientValue, which is part of the Office 365 REST API client framework, and is used to encapsulate and transfer app metadata between client and server. The class stores three key pieces of information: the OAuth principal ID for authentication, the full web URL where the app is hosted, and the timestamp when the app was created. This is typically used when querying or managing tenant-level applications in SharePoint Online or other Office 365 services.
Source Code
class TenantAppInformation(ClientValue):
"""Specifies the information for the tenant-scoped app."""
def __init__(
self, app_principal_id=None, app_web_full_url=None, creation_time=None
):
"""
:param str app_principal_id: Specifies the OAuth Id for the tenant-scoped app.
:param str app_web_full_url: Specifies the web full URL for the tenant-scoped app.
:param datetime.datetime creation_time: Specifies the creation time for the tenant-scoped app.
"""
self.AppPrincipalId = app_principal_id
self.AppWebFullUrl = app_web_full_url
self.CreationTime = creation_time
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
app_principal_id: The OAuth identifier (client ID) for the tenant-scoped application. This is a unique string that identifies the app within the Azure AD/Entra ID tenant and is used for authentication and authorization purposes. Can be None if not yet assigned or unknown.
app_web_full_url: The complete URL where the tenant-scoped app's web interface is hosted. This is typically a SharePoint site URL or app-specific endpoint. Can be None if the app doesn't have a web interface or the URL is not available.
creation_time: A datetime object representing when the tenant-scoped app was created or registered in the tenant. Can be None if the creation time is unknown or not tracked.
Return Value
Instantiation returns a TenantAppInformation object that encapsulates the provided app information. The object itself doesn't have methods that return values, but its attributes can be accessed directly. When used with the Office 365 client framework, this object may be serialized to/from JSON for API communication.
Class Interface
Methods
__init__(self, app_principal_id=None, app_web_full_url=None, creation_time=None)
Purpose: Initializes a new TenantAppInformation instance with the provided app metadata
Parameters:
app_principal_id: Optional string containing the OAuth principal ID for the tenant-scoped appapp_web_full_url: Optional string containing the full web URL for the tenant-scoped appcreation_time: Optional datetime object representing when the app was created
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
AppPrincipalId |
str or None | Stores the OAuth identifier (client ID) for the tenant-scoped application | instance |
AppWebFullUrl |
str or None | Stores the complete URL where the tenant-scoped app's web interface is hosted | instance |
CreationTime |
datetime.datetime or None | Stores the timestamp when the tenant-scoped app was created or registered | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
Usage Example
from office365.runtime.client_value import ClientValue
from datetime import datetime
# Create a new tenant app information object
app_info = TenantAppInformation(
app_principal_id='12345678-1234-1234-1234-123456789abc',
app_web_full_url='https://contoso.sharepoint.com/sites/myapp',
creation_time=datetime(2024, 1, 15, 10, 30, 0)
)
# Access the attributes
print(f'App Principal ID: {app_info.AppPrincipalId}')
print(f'App Web URL: {app_info.AppWebFullUrl}')
print(f'Created: {app_info.CreationTime}')
# Create with partial information
app_info_partial = TenantAppInformation(
app_principal_id='87654321-4321-4321-4321-cba987654321'
)
print(f'Principal ID: {app_info_partial.AppPrincipalId}')
print(f'URL: {app_info_partial.AppWebFullUrl}') # Will be None
Best Practices
- This is a simple data container class with no business logic, so instantiation is straightforward with no special lifecycle considerations.
- The class uses PascalCase for attribute names (AppPrincipalId, AppWebFullUrl, CreationTime) following Office 365 API conventions, while constructor parameters use snake_case following Python conventions.
- All constructor parameters are optional and default to None, allowing partial instantiation when not all information is available.
- This class is immutable by convention - attributes should be set during initialization and not modified afterward to maintain data integrity.
- When used with the Office 365 client framework, this object is typically populated automatically from API responses rather than manually instantiated.
- The creation_time parameter should be a datetime object, not a string. Ensure proper datetime parsing when working with API responses.
- Since this inherits from ClientValue, it likely has serialization capabilities for JSON/XML communication with Office 365 services, though these methods are inherited and not visible in this class definition.
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class TenantInformation 75.9% similar
-
class AppProperties 70.5% similar
-
class TenantAppUtility 68.6% similar
-
class TenantAppInstance 67.5% similar
-
class AppIdentity 65.3% similar