def __method_descriptor(self, service, method_info,
                          protorpc_method_info):
    """Describes a method.

    Args:
      service: endpoints.Service, Implementation of the API as a service.
      method_info: _MethodInfo, Configuration for the method.
      protorpc_method_info: protorpc.remote._RemoteMethodInfo, ProtoRPC
        description of the method.

    Returns:
      Dictionary describing the method.
    """
    descriptor = {}

    request_message_type = (resource_container.ResourceContainer.
                            get_request_message(protorpc_method_info.remote))
    request_kind = self.__get_request_kind(method_info)
    remote_method = protorpc_method_info.remote

    method_id = method_info.method_id(service.api_info)

    path = method_info.get_path(service.api_info)

    description = protorpc_method_info.remote.method.__doc__

    descriptor['id'] = method_id
    descriptor['path'] = path
    descriptor['httpMethod'] = method_info.http_method

    if description:
      descriptor['description'] = description

    descriptor['scopes'] = [
        'https://www.googleapis.com/auth/userinfo.email'
    ]

    parameters = self.__params_descriptor(
        request_message_type, request_kind, path, method_id,
        method_info.request_params_class)
    if parameters:
      descriptor['parameters'] = parameters

    if method_info.request_params_class:
      parameter_order = self.__params_order_descriptor(
        method_info.request_params_class, path, is_params_class=True)
    else:
      parameter_order = self.__params_order_descriptor(
        request_message_type, path, is_params_class=False)
    if parameter_order:
      descriptor['parameterOrder'] = parameter_order

    request_descriptor = self.__request_message_descriptor(
        request_kind, request_message_type, method_id,
        method_info.request_body_class)
    if request_descriptor is not None:
      descriptor['request'] = request_descriptor

    response_descriptor = self.__response_message_descriptor(
        remote_method.response_type(), method_info.method_id(service.api_info))
    if response_descriptor is not None:
      descriptor['response'] = response_descriptor

    return descriptor
def __method_descriptor ( self , service , method_info , protorpc_method_info ) : descriptor = { } request_message_type = ( resource_container . ResourceContainer . get_request_message ( protorpc_method_info . remote ) ) request_kind = self . __get_request_kind ( method_info ) remote_method = protorpc_method_info . remote method_id = method_info . method_id ( service . api_info ) path = method_info . get_path ( service . api_info ) description = protorpc_method_info . remote . method . __doc__ descriptor [ 'id' ] = method_id descriptor [ 'path' ] = path descriptor [ 'httpMethod' ] = method_info . http_method if description : descriptor [ 'description' ] = description descriptor [ 'scopes' ] = [ 'https://www.googleapis.com/auth/userinfo.email' ] parameters = self . __params_descriptor ( request_message_type , request_kind , path , method_id , method_info . request_params_class ) if parameters : descriptor [ 'parameters' ] = parameters if method_info . request_params_class : parameter_order = self . __params_order_descriptor ( method_info . request_params_class , path , is_params_class = True ) else : parameter_order = self . __params_order_descriptor ( request_message_type , path , is_params_class = False ) if parameter_order : descriptor [ 'parameterOrder' ] = parameter_order request_descriptor = self . __request_message_descriptor ( request_kind , request_message_type , method_id , method_info . request_body_class ) if request_descriptor is not None : descriptor [ 'request' ] = request_descriptor response_descriptor = self . __response_message_descriptor ( remote_method . response_type ( ) , method_info . method_id ( service . api_info ) ) if response_descriptor is not None : descriptor [ 'response' ] = response_descriptor return descriptor
Describes a method.

    Args:
      service: endpoints.Service, Implementation of the API as a service.
      method_info: _MethodInfo, Configuration for the method.
      protorpc_method_info: protorpc.remote._RemoteMethodInfo, ProtoRPC
        description of the method.

    Returns:
      Dictionary describing the method.