🔍 Code Extractor

class ODataV3MetadataLevel

Maturity: 41

A class that defines constants for OData v3 metadata level options, controlling the amount of metadata information included in OData response payloads.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/runtime/odata/v3/metadata_level.py
Lines:
1 - 14
Complexity:
simple

Purpose

This class serves as a container for OData v3 metadata level constants that specify how much control information should be included in serialized OData responses. It provides three standard metadata levels: Verbose (all control information), NoMetadata (minimal control information), and MinimalMetadata (computable control information removed). This is typically used when configuring OData services or clients to control response verbosity and payload size.

Source Code

class ODataV3MetadataLevel:
    """The amount of metadata information to serialize in an OData response."""

    def __init__(self):
        pass

    Verbose = "verbose"
    """Indicates that the service MUST include all control information explicitly in the payload."""

    NoMetadata = "nometadata"
    """Indicates that the service SHOULD omit control information other than odata.nextLink and odata.count"""

    MinimalMetadata = "minimalmetadata"
    """Indicates that the service SHOULD remove computable control information from the payload wherever possible"""

Parameters

Name Type Default Kind
bases - -

Parameter Details

__init__: The constructor takes no parameters and performs no initialization. It exists only to allow instantiation of the class, though the class is primarily used for its class-level constant attributes rather than instances.

Return Value

Instantiation returns an ODataV3MetadataLevel object with no instance-specific state. The class attributes (Verbose, NoMetadata, MinimalMetadata) are string constants that can be accessed either through the class directly or through instances.

Class Interface

Methods

__init__(self)

Purpose: Initializes an instance of ODataV3MetadataLevel with no specific state or configuration

Returns: None - constructor returns an instance of ODataV3MetadataLevel

Attributes

Name Type Description Scope
Verbose str Constant string 'verbose' indicating that the service must include all control information explicitly in the payload class
NoMetadata str Constant string 'nometadata' indicating that the service should omit control information other than odata.nextLink and odata.count class
MinimalMetadata str Constant string 'minimalmetadata' indicating that the service should remove computable control information from the payload wherever possible class

Usage Example

# Access metadata level constants directly from the class
metadata_level = ODataV3MetadataLevel.Verbose
print(metadata_level)  # Output: 'verbose'

# Or create an instance (though not typically necessary)
metadata_config = ODataV3MetadataLevel()
print(metadata_config.MinimalMetadata)  # Output: 'minimalmetadata'

# Common usage in OData configuration
def configure_odata_response(metadata_level):
    if metadata_level == ODataV3MetadataLevel.Verbose:
        # Include all control information
        pass
    elif metadata_level == ODataV3MetadataLevel.NoMetadata:
        # Omit most control information
        pass
    elif metadata_level == ODataV3MetadataLevel.MinimalMetadata:
        # Remove computable control information
        pass

configure_odata_response(ODataV3MetadataLevel.MinimalMetadata)

Best Practices

  • Access the metadata level constants directly from the class (e.g., ODataV3MetadataLevel.Verbose) rather than creating instances, as this is a constant container class.
  • Use these constants when configuring OData services to ensure consistent metadata level specification across your application.
  • The class follows an enum-like pattern but uses string constants instead of Python's Enum class, making it compatible with older Python versions.
  • These constants should be treated as immutable and not modified at runtime.
  • When implementing OData services, use these constants to validate metadata level parameters from client requests.

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class ODataV4MetadataLevel 89.4% similar

    A class that defines constants for OData V4 metadata level options used in HTTP Accept headers or $format query parameters.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/runtime/odata/v4/metadata_level.py
  • class ODataJsonFormat 61.1% similar

    Abstract base class defining the interface for OData JSON format implementations with configurable metadata levels.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/runtime/odata/json_format.py
  • class ODataMethod 60.5% similar

    A data class representing an OData method with its metadata including name, parameters, beta status, and return type information.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/runtime/odata/method.py
  • class V4JsonFormat 58.1% similar

    V4JsonFormat is a class that implements OData V4 JSON format specifications, managing metadata levels, IEEE754 compatibility, and streaming options for JSON serialization.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/runtime/odata/v4/json_format.py
  • class ODataV3Reader 57.3% similar

    ODataV3Reader is a specialized reader class for parsing OData v3 metadata documents, extending the base ODataReader with v3-specific XML namespace configurations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/runtime/odata/v3/metadata_reader.py
← Back to Browse