🔍 Code Extractor

class ResultInfo

Maturity: 53

A class representing result information for operations, containing success and failure details with HTTP-style status codes and sub-codes.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/communications/result_info.py
Lines:
4 - 13
Complexity:
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

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SignInStatus 59.6% similar

    A data class that encapsulates the sign-in status information, including success or failure details, error codes, and failure reasons for authentication activities.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/directory/audit/signins/status.py
  • class ClientResult 59.3% similar

    Client result

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/runtime/client_result.py
  • class FollowResult 57.4% similar

    A data class that encapsulates the result of a follow operation on a SharePoint item, containing the followed item and the result status.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/userprofiles/follow_result.py
  • class DlpClassificationResult 57.0% similar

    A class representing the result of a DLP (Data Loss Prevention) classification operation in SharePoint's compliance policy system.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/compliance/dlp_classification_result.py
  • class SPInvitationCreationResult 56.2% similar

    A data class representing the result of creating a SharePoint invitation, containing email, invitation link, and success status.

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