code: def __method_descriptor(self, service, method_info, operation_id,
                            protorpc_method_info, security_definitions):
      
      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
  
      path = method_info.get_path(service.api_info)
  
      descriptor['parameters'] = self.__request_message_descriptor(
          request_kind, request_message_type,
          method_info.method_id(service.api_info),
          path)
      descriptor['responses'] = self.__response_message_descriptor(
          remote_method.response_type(), method_info.method_id(service.api_info))
      descriptor['operationId'] = operation_id
  
      # Insert the auth audiences, if any
      api_key_required = method_info.is_api_key_required(service.api_info)
      if method_info.audiences is not None:
        descriptor['security'] = self.__security_descriptor(
            method_info.audiences, security_definitions,
            api_key_required=api_key_required)
      elif service.api_info.audiences is not None or api_key_required:
        descriptor['security'] = self.__security_descriptor(
            service.api_info.audiences, security_definitions,
            api_key_required=api_key_required)
  
      # Insert the metric costs, if any
      if method_info.metric_costs:
        descriptor['x-google-quota'] = self.__x_google_quota_descriptor(
            method_info.metric_costs)
  
      return descriptor
docs: Describes a method.
  
      Args:
        service: endpoints.Service, Implementation of the API as a service.
        method_info: _MethodInfo, Configuration for the method.
        operation_id: string, Operation ID of the method
        protorpc_method_info: protorpc.remote._RemoteMethodInfo, ProtoRPC
          description of the method.
        security_definitions: list of dicts, security definitions for the API.
  
      Returns:
        Dictionary describing the method.