l.s.w.apihelpers : module documentation

Part of lp.services.webservice

Helpers to patch circular import shortcuts for the webservice.

Many of the exports for the webservice entries deliberately set various types to Interface because using the real types cause circular import problems.

The only current option is to later patch the types to the correct value. The helper functions in this file make that easy.

Function patch_entry_return_type Update return type for a webservice method that returns entries.
Function patch_collection_return_type Update return type for a webservice method that returns a collection.
Function patch_list_parameter_type Update a list parameter type for a webservice method.
Function patch_plain_parameter_type Update a plain parameter type for a webservice method.
Function patch_choice_parameter_type Update a Choice parameter type for a webservice method.
Function patch_reference_property Set the type of the given property on the given class.
Function patch_collection_property Set the collection type of the given property on the given class.
Function patch_choice_property Set the Choice type of the given property on the given class.
Function patch_entry_explicit_version Make it look as though an entry definition used as_of.
Function patch_operations_explicit_version Make it look like operations' first tags were @operation_for_version.
Function patch_operation_explicit_version Make it look like an operation's first tag was @operation_for_version.
def patch_entry_return_type(exported_class, method_name, return_type):
Update return type for a webservice method that returns entries.
Parametersexported_classThe class containing the method.
method_nameThe method name that you need to patch.
return_typeThe new return type for the method.
def patch_collection_return_type(exported_class, method_name, return_type):
Update return type for a webservice method that returns a collection.
Parametersexported_classThe class containing the method.
method_nameThe method name that you need to patch.
return_typeThe new return type for the method.
def patch_list_parameter_type(exported_class, method_name, param_name, param_type):
Update a list parameter type for a webservice method.
Parametersexported_classThe class containing the method.
method_nameThe method name that you need to patch.
param_nameThe name of the parameter that you need to patch.
param_typeThe new type for the parameter.
def patch_plain_parameter_type(exported_class, method_name, param_name, param_type):
Update a plain parameter type for a webservice method.
Parametersexported_classThe class containing the method.
method_nameThe method name that you need to patch.
param_nameThe name of the parameter that you need to patch.
param_typeThe new type for the parameter.
def patch_choice_parameter_type(exported_class, method_name, param_name, choice_type):
Update a Choice parameter type for a webservice method.
Parametersexported_classThe class containing the method.
method_nameThe method name that you need to patch.
param_nameThe name of the parameter that you need to patch.
choice_typeThe new choice type for the parameter.
def patch_reference_property(exported_class, property_name, property_type):
Set the type of the given property on the given class.
Parametersexported_classThe class containing the property.
property_nameThe name of the property whose type you need to patch.
property_typeThe new type for the property.
def patch_collection_property(exported_class, property_name, collection_type):
Set the collection type of the given property on the given class.
Parametersexported_classThe class containing the property.
property_nameThe name of the property whose type you need to patch.
collection_typeThe Collection type.
def patch_choice_property(exported_class, property_name, choice_type):
Set the Choice type of the given property on the given class.
Parametersexported_classThe class containing the property.
property_nameThe name of the property whose type you need to patch.
choice_typeThe new Choice type for the property.
def patch_entry_explicit_version(interface, version):
Make it look as though an entry definition used as_of.

This function should be phased out in favor of actually using as_of. This function patches the entry's fields as well as the entry itself. Fields that are explicitly published as of a given version (even though the entry is not) are ignored.

def patch_operations_explicit_version(interface, version, *method_names):
Make it look like operations' first tags were @operation_for_version.

This function should be phased out in favor of actually using @operation_for_version, everywhere.

def patch_operation_explicit_version(interface, version, method_name):
Make it look like an operation's first tag was @operation_for_version.

This function should be phased out in favor of actually using @operation_for_version, everywhere.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.