class StaticOperationPath
A specialized path class for representing static operation paths in Office365 service operations, inheriting from ServiceOperationPath.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/internal/paths/static_operation.py
6 - 9
simple
Purpose
StaticOperationPath is a subclass of ServiceOperationPath designed to represent static (non-dynamic) operation paths in Office365 API interactions. It provides a way to define fixed operation endpoints with optional parameters. This class is typically used when constructing URLs or paths for Office365 service operations that don't require dynamic path segments, serving as a building block for API request construction in the Office365 SDK.
Source Code
class StaticOperationPath(ServiceOperationPath):
def __init__(self, static_name, parameters=None):
# type: (str, Optional[Dict]) -> None
super(StaticOperationPath, self).__init__(static_name, parameters)
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ServiceOperationPath | - |
Parameter Details
static_name: A string representing the name of the static operation. This is the fixed identifier for the operation endpoint being accessed. It should be a valid operation name recognized by the Office365 service API.
parameters: An optional dictionary containing key-value pairs of parameters to be associated with this operation path. These parameters may be used for query strings, request body data, or other operation-specific configuration. Defaults to None if no parameters are needed.
Return Value
Instantiation returns a StaticOperationPath object that represents a static operation path with the specified name and optional parameters. The object inherits all methods and attributes from ServiceOperationPath and can be used to construct API requests or navigate service operation hierarchies.
Class Interface
Methods
__init__(static_name: str, parameters: Optional[Dict] = None) -> None
Purpose: Initializes a StaticOperationPath instance with a static operation name and optional parameters
Parameters:
static_name: String identifier for the static operation endpointparameters: Optional dictionary of parameters associated with the operation
Returns: None - constructor initializes the instance
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
static_name |
str | The name of the static operation, inherited from parent class initialization | instance |
parameters |
Optional[Dict] | Dictionary of parameters associated with this operation path, inherited from parent class | instance |
Dependencies
typingoffice365
Required Imports
from typing import Dict
from typing import Optional
from office365.runtime.paths.service_operation import ServiceOperationPath
Usage Example
from office365.runtime.paths.static_operation import StaticOperationPath
# Create a static operation path without parameters
path1 = StaticOperationPath('GetUserProfile')
# Create a static operation path with parameters
params = {'userId': '12345', 'includeDetails': True}
path2 = StaticOperationPath('GetUserData', parameters=params)
# The path object can now be used in Office365 API operations
# Typically passed to service client methods for request construction
Best Practices
- Use StaticOperationPath for fixed, non-dynamic operation endpoints in Office365 services
- Provide meaningful static_name values that correspond to actual Office365 API operations
- Use the parameters dictionary for operation-specific configuration rather than embedding them in the static_name
- This class is typically instantiated internally by Office365 SDK methods rather than directly by end users
- Ensure the parent ServiceOperationPath class is available and properly imported
- The class maintains immutable operation path information once created
- Consider using this class as part of a larger request building pipeline rather than in isolation
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ServiceOperationPath 74.8% similar
-
class ServiceOperationQuery 62.2% similar
-
class ItemPath 59.9% similar
-
class WebPath 59.9% similar
-
class EntityPath_v1 59.5% similar