flag request API as not_implemented
This commit is contained in:
parent
49b03750e4
commit
e19a9a5bed
|
@ -24,6 +24,8 @@ module Travis
|
|||
LoginRequired = ClientError .create('login required', status: 403)
|
||||
InsufficientAccess = ClientError .create(status: 403)
|
||||
WrongParams = ClientError .create('wrong parameters')
|
||||
ServerError = Error .create(status: 500)
|
||||
NotImplemented = ServerError .create(status: 501, 'request not (yet) implemented')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,6 +29,10 @@ module Travis::API::V3
|
|||
raise(error, type || self.class.result_type)
|
||||
end
|
||||
|
||||
def run!
|
||||
not_implemented
|
||||
end
|
||||
|
||||
def run
|
||||
not_found unless result = run!
|
||||
result = Result.new(self.class.result_type, result) unless result.is_a? Result
|
||||
|
@ -38,5 +42,9 @@ module Travis::API::V3
|
|||
def accepted(type = self.class.result_type)
|
||||
Result.new(:accepted, type, status: 202)
|
||||
end
|
||||
|
||||
def not_implemented
|
||||
raise NotImplemented
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,6 +3,7 @@ module Travis::API::V3
|
|||
helpers :repository
|
||||
|
||||
def run
|
||||
not_implemented
|
||||
query.schedule_for(repository)
|
||||
accepted
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user