🔍 Code Extractor

class Domain

Maturity: 39

Represents a domain associated with the tenant. Use domain operations to associate domains to a tenant, verify domain ownership, and configure supported services. Domain operations enable registrars to automate domain association for services such as Microsoft 365. For example, as part of domain sign up, a registrar can enable a vanity domain for email, websites, authentication, etc.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/domains/domain.py
Lines:
11 - 97
Complexity:
moderate

Purpose

Represents a domain associated with the tenant. Use domain operations to associate domains to a tenant, verify domain ownership, and configure supported services. Domain operations enable registrars to automate domain association for services such as Microsoft 365. For example, as part of domain sign up, a registrar can enable a vanity domain for email, websites, authentication, etc.

Source Code

class Domain(Entity):
    """
    Represents a domain associated with the tenant.

    Use domain operations to associate domains to a tenant, verify domain ownership, and configure supported services.
    Domain operations enable registrars to automate domain association for services such as Microsoft 365.
    For example, as part of domain sign up, a registrar can enable a vanity domain for email, websites,
    authentication, etc.
    """

    def verify(self):
        """Validates the ownership of the domain."""
        return_type = Domain(self.context)
        self.parent_collection.add_child(return_type)
        qry = ServiceOperationQuery(self, "verify", return_type=return_type)
        self.context.add_query(qry)
        return return_type

    @property
    def supported_services(self):
        """
        The capabilities assigned to the domain. Can include 0, 1 or more of following values:
        Email, Sharepoint, EmailInternalRelayOnly, OfficeCommunicationsOnline, SharePointDefaultDomain,
        FullRedelegation, SharePointPublic, OrgIdAuthentication, Yammer, Intune.
        The values which you can add/remove using Graph API include: Email, OfficeCommunicationsOnline, Yammer.
        """
        return self.properties.get("supportedServices", StringCollection())

    @property
    def domain_name_references(self):
        """
        The objects such as users and groups that reference the domain ID. Read-only, Nullable.
        Supports $expand and $filter by the OData type of objects returned.
        For example /domains/{domainId}/domainNameReferences/microsoft.graph.user
        and /domains/{domainId}/domainNameReferences/microsoft.graph.group.
        """
        return self.properties.get(
            "domainNameReferences",
            DirectoryObjectCollection(
                self.context, ResourcePath("domainNameReferences", self.resource_path)
            ),
        )

    @property
    def service_configuration_records(self):
        """
        DNS records the customer adds to the DNS zone file of the domain before the domain can be used by
        Microsoft Online services. Read-only, Nullable. Supports $expand.
        """
        return self.properties.get(
            "serviceConfigurationRecords",
            EntityCollection(
                self.context,
                DomainDnsRecord,
                ResourcePath("serviceConfigurationRecords", self.resource_path),
            ),
        )

    @property
    def verification_dns_records(self):
        """
        DNS records that the customer adds to the DNS zone file of the domain before the customer can complete
        domain ownership verification with Azure AD. Read-only, Nullable. Supports $expand.
        """
        return self.properties.get(
            "verificationDnsRecords",
            EntityCollection(
                self.context,
                DomainDnsRecord,
                ResourcePath("verificationDnsRecords", self.resource_path),
            ),
        )

    @property
    def state(self):
        """Status of asynchronous operations scheduled for the domain."""
        return self.properties.get("state", DomainState())

    def get_property(self, name, default_value=None):
        if default_value is None:
            property_mapping = {
                "domainNameReferences": self.domain_name_references,
                "serviceConfigurationRecords": self.service_configuration_records,
                "verificationDnsRecords": self.verification_dns_records,
            }
            default_value = property_mapping.get(name, None)
        return super(Domain, self).get_property(name, default_value)

Parameters

Name Type Default Kind
bases Entity -

Parameter Details

bases: Parameter of type Entity

Return Value

Returns unspecified type

Class Interface

Methods

verify(self)

Purpose: Validates the ownership of the domain.

Returns: None

supported_services(self) property

Purpose: The capabilities assigned to the domain. Can include 0, 1 or more of following values: Email, Sharepoint, EmailInternalRelayOnly, OfficeCommunicationsOnline, SharePointDefaultDomain, FullRedelegation, SharePointPublic, OrgIdAuthentication, Yammer, Intune. The values which you can add/remove using Graph API include: Email, OfficeCommunicationsOnline, Yammer.

Returns: None

domain_name_references(self) property

Purpose: The objects such as users and groups that reference the domain ID. Read-only, Nullable. Supports $expand and $filter by the OData type of objects returned. For example /domains/{domainId}/domainNameReferences/microsoft.graph.user and /domains/{domainId}/domainNameReferences/microsoft.graph.group.

Returns: See docstring for return details

service_configuration_records(self) property

Purpose: DNS records the customer adds to the DNS zone file of the domain before the domain can be used by Microsoft Online services. Read-only, Nullable. Supports $expand.

Returns: None

verification_dns_records(self) property

Purpose: DNS records that the customer adds to the DNS zone file of the domain before the customer can complete domain ownership verification with Azure AD. Read-only, Nullable. Supports $expand.

Returns: None

state(self) property

Purpose: Status of asynchronous operations scheduled for the domain.

Returns: None

get_property(self, name, default_value)

Purpose: Retrieves property

Parameters:

  • name: Parameter
  • default_value: Parameter

Returns: None

Required Imports

from office365.directory.domains.dns_record import DomainDnsRecord
from office365.directory.domains.state import DomainState
from office365.directory.object_collection import DirectoryObjectCollection
from office365.entity import Entity
from office365.entity_collection import EntityCollection

Usage Example

# Example usage:
# result = Domain(bases)

Tags

class domain

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class VerifiedDomain 65.3% similar

    A class representing a verified domain for a tenant in Microsoft 365/Office 365, inheriting from ClientValue to provide domain verification information.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/domains/verified.py
  • class DomainDnsRecord 62.5% similar

    Represents a DNS record that must be added to a domain's DNS zone file before the domain can be used by Microsoft Online Services.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/domains/dns_record.py
  • class TenantRelationship 59.2% similar

    A class representing tenant relationships in Azure AD, providing methods to query and validate tenant information across different Azure AD tenants.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/tenant_relationship.py
  • class DomainState 57.0% similar

    A class representing the status of asynchronous operations scheduled on a domain, inheriting from ClientValue.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/domains/state.py
  • class TenantInformation 56.4% similar

    A data class representing publicly displayed information about an Azure AD tenant, including domain name, display name, federation brand name, and tenant ID.

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