class TermsOfUseContainer
A container class that provides access to Azure Active Directory's terms of use API, exposing relationships for managing agreements and agreement acceptances.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/identitygovernance/termsofuse/container.py
10 - 37
moderate
Purpose
This class serves as a container entity for Azure AD's terms of use functionality. It provides property-based access to two main collections: 'agreements' (tenant's customizable terms of use agreements) and 'agreementAcceptances' (user responses to terms of use agreements). The class inherits from Entity and uses lazy-loading patterns to instantiate EntityCollection objects only when accessed.
Source Code
class TermsOfUseContainer(Entity):
"""Container for the relationships that expose the terms of use API and its features.
Currently exposes the agreements and agreementAcceptances relationships."""
@property
def agreements(self):
"""Represents a tenant's customizable terms of use agreement that's created and managed with
Azure Active Directory (Azure AD)."""
return self.properties.get(
"agreements",
EntityCollection(
self.context, Agreement, ResourcePath("agreements", self.resource_path)
),
)
@property
def agreement_acceptances(self):
"""
Represents the current status of a user's response to a company's customizable terms of use agreement.
"""
return self.properties.get(
"agreementAcceptances",
EntityCollection(
self.context,
AgreementAcceptance,
ResourcePath("agreementAcceptances", self.resource_path),
),
)
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
Entity | - |
Parameter Details
context: The context object required by the parent Entity class, typically containing authentication and connection information for Azure AD API calls
resource_path: The resource path inherited from Entity that defines the API endpoint location for this container
Return Value
Instantiation returns a TermsOfUseContainer object that provides access to agreements and agreementAcceptances collections. The properties return EntityCollection objects containing Agreement and AgreementAcceptance entities respectively.
Class Interface
Methods
@property agreements(self) -> EntityCollection
property
Purpose: Provides access to the collection of tenant's customizable terms of use agreements created and managed with Azure Active Directory
Returns: EntityCollection containing Agreement objects representing the tenant's terms of use agreements
@property agreement_acceptances(self) -> EntityCollection
property
Purpose: Provides access to the collection representing the current status of users' responses to the company's customizable terms of use agreements
Returns: EntityCollection containing AgreementAcceptance objects representing user responses to terms of use agreements
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
context |
ClientContext | Inherited from Entity, stores the authentication and connection context for Azure AD API calls | instance |
resource_path |
ResourcePath | Inherited from Entity, defines the API endpoint path for this container resource | instance |
properties |
dict | Inherited from Entity, stores cached property values including lazy-loaded collections | instance |
Dependencies
office365
Required Imports
from office365.directory.identitygovernance.termsofuse.agreement import Agreement
from office365.directory.identitygovernance.termsofuse.agreement_acceptance import AgreementAcceptance
from office365.entity import Entity
from office365.entity_collection import EntityCollection
from office365.runtime.paths.resource_path import ResourcePath
Usage Example
# Assuming you have an authenticated context object
from office365.directory.identitygovernance.termsofuse.container import TermsOfUseContainer
# Instantiate the container (typically done through parent API client)
terms_container = TermsOfUseContainer(context)
# Access agreements collection
agreements = terms_container.agreements
for agreement in agreements:
print(agreement.displayName)
# Access agreement acceptances
acceptances = terms_container.agreement_acceptances
for acceptance in acceptances:
print(acceptance.userId, acceptance.agreementId)
Best Practices
- This class is typically instantiated through a parent API client rather than directly, as it requires a properly configured context object
- Properties use lazy loading - collections are only instantiated when first accessed, improving performance
- The class maintains state through the inherited Entity properties dictionary
- Always ensure the context object has valid authentication before accessing properties
- Collections are cached in the properties dictionary after first access to avoid redundant instantiation
- This is a read-only container class - modifications should be made through the returned EntityCollection objects
- The class follows the Microsoft Graph API structure for Azure AD identity governance
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class Agreement 80.6% similar
-
class AgreementAcceptance 72.3% similar
-
class IdentityContainer 65.4% similar
-
class IdentityGovernance 63.2% similar
-
class AppConsentApprovalRoute 58.2% similar