🔍 Code Extractor

class ReportBase

Maturity: 31

ReportBase is a base class representing a report entity in Microsoft Office Server Search REST API, inheriting from ClientValue to provide client-side value representation.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/reports/base.py
Lines:
4 - 10
Complexity:
simple

Purpose

This class serves as a base model for search report entities in the Office 365 SharePoint Search REST API. It encapsulates farm-level reporting data and provides type identification for serialization/deserialization in REST API communications. The class is designed to be extended by more specific report types and integrates with the Office 365 client-side value system.

Source Code

class ReportBase(ClientValue):
    def __init__(self, farm_id=None):
        self.FarmId = farm_id

    @property
    def entity_type_name(self):
        return "Microsoft.Office.Server.Search.REST.ReportBase"

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

farm_id: Optional identifier for the SharePoint farm associated with this report. Can be None if not applicable or not yet assigned. This ID is used to scope the report to a specific farm deployment in multi-farm environments.

Return Value

Instantiation returns a ReportBase object with the specified farm_id. The entity_type_name property returns a string 'Microsoft.Office.Server.Search.REST.ReportBase' which identifies the entity type for REST API serialization.

Class Interface

Methods

__init__(self, farm_id=None)

Purpose: Initializes a new ReportBase instance with an optional farm identifier

Parameters:

  • farm_id: Optional farm identifier (default: None). Can be a string or any type representing a farm ID

Returns: None (constructor)

@property entity_type_name(self) -> str property

Purpose: Returns the fully qualified entity type name for REST API serialization and type identification

Returns: String 'Microsoft.Office.Server.Search.REST.ReportBase' representing the entity type

Attributes

Name Type Description Scope
FarmId Any (typically string or None) Stores the farm identifier associated with this report. Can be None if not set or not applicable. Used to scope reports to specific SharePoint farm deployments. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue

Usage Example

from office365.runtime.client_value import ClientValue

class ReportBase(ClientValue):
    def __init__(self, farm_id=None):
        self.FarmId = farm_id

    @property
    def entity_type_name(self):
        return "Microsoft.Office.Server.Search.REST.ReportBase"

# Create a report instance without farm_id
report = ReportBase()
print(report.FarmId)  # None
print(report.entity_type_name)  # Microsoft.Office.Server.Search.REST.ReportBase

# Create a report instance with farm_id
report_with_farm = ReportBase(farm_id="farm-123")
print(report_with_farm.FarmId)  # farm-123

# Modify farm_id after instantiation
report.FarmId = "farm-456"
print(report.FarmId)  # farm-456

Best Practices

  • This is a base class intended to be extended by specific report types rather than used directly in most cases
  • The FarmId attribute can be set during initialization or modified later as needed
  • The entity_type_name property should not be overridden unless creating a derived class with a different entity type
  • Ensure proper inheritance from ClientValue is maintained when extending this class
  • The class follows Office 365 naming conventions with PascalCase for attributes (FarmId)
  • This class is stateless and immutable in terms of behavior, making it safe for concurrent use
  • When extending this class, maintain the entity_type_name pattern for proper REST API integration

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class Entity 66.3% similar

    Base class for SharePoint entities that provides common operations like create, read, update, and delete (CRUD) functionality for SharePoint objects.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/entity.py
  • class SiteSharingReportStatus 65.8% similar

    SiteSharingReportStatus is a data transfer object class that represents the status of a site sharing report in Microsoft 365/SharePoint operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/site_sharing_report_status.py
  • class SiteSharingReportCapabilities 64.5% similar

    SiteSharingReportCapabilities is a data transfer object class that inherits from ClientValue, representing capabilities related to site sharing reports in Office 365/SharePoint.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/sharing/reports/site_capabilities.py
  • class ReportTopQueries 63.1% similar

    A specialized report class for retrieving top search queries from SharePoint Search REST API.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/search/reports/top_queries.py
  • class BaseGptResponse 62.5% similar

    BaseGptResponse is a data model class that represents a base GPT response entity in the Microsoft SharePoint Internal API, inheriting from ClientValue.

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