Add path param description support
This commit is contained in:
parent
d9accd0593
commit
e0bb94e439
3 changed files with 25 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
from endpoints.api import (resource, nickname, ApiResource, log_action, related_user_resource,
|
||||
Unauthorized, require_user_admin, internal_only, require_scope)
|
||||
Unauthorized, require_user_admin, internal_only, require_scope,
|
||||
path_param)
|
||||
from auth.permissions import AdministerOrganizationPermission, OrganizationMemberPermission
|
||||
from auth.auth_context import get_authenticated_user
|
||||
from auth import scopes
|
||||
|
@ -30,6 +31,7 @@ class UserRobotList(ApiResource):
|
|||
|
||||
|
||||
@resource('/v1/user/robots/<robot_shortname>')
|
||||
@path_param('robot_shortname', 'The short name for the robot, without any user or organization prefix')
|
||||
@internal_only
|
||||
class UserRobot(ApiResource):
|
||||
""" Resource for managing a user's robots. """
|
||||
|
@ -53,6 +55,7 @@ class UserRobot(ApiResource):
|
|||
|
||||
|
||||
@resource('/v1/organization/<orgname>/robots')
|
||||
@path_param('orgname', 'The name of the organization')
|
||||
@related_user_resource(UserRobotList)
|
||||
class OrgRobotList(ApiResource):
|
||||
""" Resource for listing an organization's robots. """
|
||||
|
@ -71,6 +74,8 @@ class OrgRobotList(ApiResource):
|
|||
|
||||
|
||||
@resource('/v1/organization/<orgname>/robots/<robot_shortname>')
|
||||
@path_param('orgname', 'The name of the organization')
|
||||
@path_param('robot_shortname', 'The short name for the robot, without any user or organization prefix')
|
||||
@related_user_resource(UserRobot)
|
||||
class OrgRobot(ApiResource):
|
||||
""" Resource for managing an organization's robots. """
|
||||
|
|
Reference in a new issue