🔍 Code Extractor

class SynchronizationTemplate

Maturity: 57

A class representing pre-configured synchronization settings for applications, providing default configurations for synchronization jobs including schema definitions.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/synchronization/template.py
Lines:
6 - 25
Complexity:
simple

Purpose

SynchronizationTemplate serves as a container for default synchronization settings that can be applied to synchronization jobs. It inherits from Entity and provides access to synchronization schemas through a property interface. Application developers create these templates to standardize synchronization configurations, and users can retrieve them to understand default settings. Multiple templates can exist per application, with the ability to designate a default template for common use cases.

Source Code

class SynchronizationTemplate(Entity):
    """
    Provides pre-configured synchronization settings for a particular application. These settings will be used by
    default for any synchronization job that is based on the template. The application developer specifies the template;
    anyone can retrieve the template to see the default settings, including the synchronization schema.

    You can provide multiple templates for an application, and designate a default template. If multiple templates
    are available for the application you're interested in, seek application-specific guidance to determine which one
    best meets your needs.
    """

    @property
    def schema(self):
        """Default synchronization schema for the jobs based on this template."""
        return self.properties.get(
            "schema",
            SynchronizationSchema(
                self.context, ResourcePath("schema", self.resource_path)
            ),
        )

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

context: The context object inherited from Entity base class, typically containing authentication and connection information for API operations

resource_path: The resource path inherited from Entity base class, defining the API endpoint location for this template resource

Return Value

Instantiation returns a SynchronizationTemplate object that provides access to synchronization configuration. The schema property returns a SynchronizationSchema object containing the default synchronization schema for jobs based on this template, either retrieved from properties or created as a new instance with the appropriate resource path.

Class Interface

Methods

@property schema(self) -> SynchronizationSchema property

Purpose: Retrieves the default synchronization schema for jobs based on this template

Returns: A SynchronizationSchema object containing the synchronization schema configuration. Returns either the cached schema from properties or creates a new instance with the appropriate resource path.

Attributes

Name Type Description Scope
context Context Inherited from Entity base class. Contains authentication and connection information for API operations. instance
resource_path ResourcePath Inherited from Entity base class. Defines the API endpoint location for this template resource. instance
properties dict Inherited from Entity base class. Dictionary containing the template's properties, including cached schema data. instance

Dependencies

  • office365.directory.synchronization.schema
  • office365.entity
  • office365.runtime.paths.resource_path

Required Imports

from office365.directory.synchronization.schema import SynchronizationSchema
from office365.entity import Entity
from office365.runtime.paths.resource_path import ResourcePath
from office365.directory.synchronization.template import SynchronizationTemplate

Usage Example

# Assuming you have an authenticated context and resource path
from office365.directory.synchronization.template import SynchronizationTemplate
from office365.runtime.paths.resource_path import ResourcePath

# Instantiate the template (typically done internally by the SDK)
template = SynchronizationTemplate(context, resource_path)

# Access the synchronization schema
schema = template.schema

# The schema property returns a SynchronizationSchema object
# which contains the default synchronization settings
print(f"Schema resource path: {schema.resource_path}")

# Templates are typically retrieved from a collection
# rather than instantiated directly
# Example: templates = app.synchronization.templates
# default_template = templates.get_by_id('template_id')
# schema = default_template.schema

Best Practices

  • SynchronizationTemplate objects are typically retrieved from the API rather than instantiated directly by users
  • The schema property uses lazy loading - it retrieves from properties if available, otherwise creates a new SynchronizationSchema instance
  • Multiple templates can exist for an application; consult application-specific documentation to choose the appropriate template
  • The template is read-only in nature - it provides default settings that are applied to synchronization jobs
  • Always ensure the context object has proper authentication before accessing template properties
  • The schema property may trigger API calls when accessed for the first time if not already cached in properties
  • Templates are designed to be reusable across multiple synchronization jobs for consistency

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SynchronizationSchema 70.9% similar

    A class representing a synchronization schema that defines what objects will be synchronized and how they will be synchronized between systems.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/synchronization/schema.py
  • class Synchronization 60.0% similar

    Represents Azure Active Directory (Azure AD) identity synchronization capabilities through Microsoft Graph API, managing automated provisioning and de-provisioning of user identities and roles.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/synchronization/synchronization.py
  • class SynchronizationJob 58.2% similar

    Manages Microsoft 365 directory synchronization jobs that periodically poll for changes in one directory and push them to another directory, specific to an application instance in a tenant.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/synchronization/job.py
  • class TeamsTemplate 56.7% similar

    A class representing a Microsoft Teams template, which serves as a blueprint for creating teams with predefined structure, settings, and content.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/teams/template.py
  • class ApplicationTemplate 56.4% similar

    Represents an application template in the Azure AD application gallery, providing methods to instantiate applications and access their metadata.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/applications/template.py
← Back to Browse