class ResultInfo
A class representing result information for operations, containing success and failure details with HTTP-style status codes and sub-codes.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/communications/result_info.py
4 - 13
simple
Purpose
ResultInfo is a data container class that inherits from ClientValue to represent the outcome of operations in the Office365 SDK. It uses HTTP-style status codes (2xx for success, 4xx for client errors, 5xx for server errors) to indicate operation results and provides supplementary sub-codes for additional context about specific success or failure scenarios, such as successful call transfers.
Source Code
class ResultInfo(ClientValue):
"""
This contains success and failure specific result information.
The code specifies if the result is a generic success or failure. If the code is 2xx it's a success,
if it's a 4xx it's a client error, and if it's 5xx, it's a server error.
The sub-codes provide supplementary information related to the type of success or failure
(e.g. a call transfer was successful)
"""
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
bases: Inherits from ClientValue, which is a base class from the Office365 runtime that provides client-side value object functionality for serialization and data handling
Return Value
Instantiation returns a ResultInfo object that can store and represent operation result information with status codes and sub-codes. The class itself serves as a data container for result metadata.
Class Interface
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
code |
int | HTTP-style status code indicating success (2xx), client error (4xx), or server error (5xx) | instance |
sub_code |
str | Supplementary code providing additional information about the specific type of success or failure (e.g., 'call_transfer_success') | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
Usage Example
from office365.runtime.client_value import ClientValue
class ResultInfo(ClientValue):
pass
# Instantiate ResultInfo
result = ResultInfo()
# Typically used to represent operation outcomes
# Success example (2xx codes)
result.code = 200 # Generic success
result.sub_code = 'call_transfer_success'
# Client error example (4xx codes)
error_result = ResultInfo()
error_result.code = 400 # Client error
error_result.sub_code = 'invalid_parameter'
# Server error example (5xx codes)
server_error = ResultInfo()
server_error.code = 500 # Server error
server_error.sub_code = 'internal_error'
Best Practices
- Use 2xx codes (200-299) to represent successful operations
- Use 4xx codes (400-499) to represent client-side errors
- Use 5xx codes (500-599) to represent server-side errors
- Provide meaningful sub-codes to give additional context about the specific type of success or failure
- This class inherits from ClientValue, so it should support serialization and deserialization patterns common to Office365 SDK client values
- Instantiate this class when you need to represent the outcome of an operation with detailed status information
- The class follows HTTP status code conventions, making it intuitive for developers familiar with REST APIs
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class SignInStatus 59.6% similar
-
class ClientResult 59.3% similar
-
class FollowResult 57.4% similar
-
class DlpClassificationResult 57.0% similar
-
class SPInvitationCreationResult 56.2% similar