class ODataParameter
A simple data class representing an OData parameter with a name and type specification.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/runtime/odata/parameter.py
1 - 4
simple
Purpose
ODataParameter is a lightweight data container class used to represent parameters in OData (Open Data Protocol) operations. It stores the parameter name and its fully qualified type name, typically used when constructing OData queries, function calls, or action invocations. This class serves as a building block for OData service interactions, allowing structured representation of parameter metadata.
Source Code
class ODataParameter(object):
def __init__(self, name=None, type_full_name=None):
self.Name = name
self.ParameterTypeFullName = type_full_name
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
object | - |
Parameter Details
name: Optional string representing the name of the OData parameter. This is the identifier used in OData operations. Defaults to None if not provided.
type_full_name: Optional string representing the fully qualified type name of the parameter (e.g., 'Edm.String', 'Edm.Int32', or custom entity type names). This follows OData type naming conventions. Defaults to None if not provided.
Return Value
Instantiation returns an ODataParameter object with two public attributes: Name (the parameter name) and ParameterTypeFullName (the parameter's type). The object itself has no methods that return values, serving purely as a data container.
Class Interface
Methods
__init__(name=None, type_full_name=None)
Purpose: Constructor that initializes an ODataParameter instance with optional name and type information
Parameters:
name: Optional string for the parameter name, defaults to Nonetype_full_name: Optional string for the fully qualified type name, defaults to None
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
Name |
str or None | Stores the name of the OData parameter. Can be None if not set during initialization or later assignment. | instance |
ParameterTypeFullName |
str or None | Stores the fully qualified type name of the parameter following OData type conventions (e.g., 'Edm.String', 'Edm.Int32'). Can be None if not set. | instance |
Usage Example
# Create an OData parameter with name and type
param1 = ODataParameter(name='customerId', type_full_name='Edm.Int32')
print(param1.Name) # Output: customerId
print(param1.ParameterTypeFullName) # Output: Edm.Int32
# Create an empty parameter and set attributes later
param2 = ODataParameter()
param2.Name = 'productName'
param2.ParameterTypeFullName = 'Edm.String'
# Create parameter with only name
param3 = ODataParameter(name='orderDate')
param3.ParameterTypeFullName = 'Edm.DateTimeOffset'
# Access attributes
if param1.Name:
print(f'Parameter {param1.Name} has type {param1.ParameterTypeFullName}')
Best Practices
- This is a simple data container with no validation - ensure you provide valid OData type names when setting ParameterTypeFullName
- The class allows None values for both attributes, so check for None before using the attributes in OData operations
- Follow OData naming conventions: use camelCase for parameter names and fully qualified type names (e.g., 'Edm.String', 'Namespace.EntityType')
- This class has no methods or business logic - it's purely for data storage and should be used as a building block in larger OData frameworks
- Attributes are public and mutable - they can be modified after instantiation
- No type checking or validation is performed - the caller is responsible for ensuring correct types and values
- Consider subclassing or wrapping this class if you need validation, type checking, or additional functionality
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class ODataProperty 69.3% similar
-
class ODataMethod 69.1% similar
-
class ODataModel 59.3% similar
-
class ODataType 56.3% similar
-
class ODataPathBuilder 55.3% similar