public interface Resource
Modifier and Type | Method and Description |
---|---|
Operation |
addOperation(Operation operation)
Add an operation object to the resource
|
Operation |
addOperation(java.lang.String name,
Method method)
Add a new operation with the specified name and HTTP method.
|
Resource |
deleteOperation(java.lang.String name)
Delete an existing operation from this resource.
|
Api |
getApi()
Get the API that this resource belongs to.
|
java.lang.String |
getDescription()
Get a description of this resource.
|
Operation |
getOperation(Method method)
Get the operation with the specified HTTP method.
|
Operation |
getOperation(java.lang.String name)
Get the operation with the specified name.
|
java.util.List<Operation> |
getOperations()
Get the list of operations that are served from this resource.
|
java.lang.String |
getPath()
Get the path that this resource is served from, for example "/customers/{id}/details".
|
Resource |
setDescription(java.lang.String description)
Set the description of this resource.
|
Resource |
setPath(java.lang.String path)
Set the path that this resource is served from, for example "/customers/{id}/details".
|
Api getApi()
java.lang.String getPath()
Resource setPath(java.lang.String path) throws ApiException
path
- the new path of this resource.ApiException
- if the path could not be changed.java.util.List<Operation> getOperations()
Operation getOperation(java.lang.String name) throws ApiException
name
- the name of the operation.ApiException
- if no operation with the specified name exists.Operation getOperation(Method method) throws ApiException
method
- the HTTP method of the operation.ApiException
- if no operation with the specified HTTP method exists.Operation addOperation(java.lang.String name, Method method) throws ApiException
name
- the name of the operation.method
- the HTTP method of the operation.ApiException
- if the new operation could not be added.Operation addOperation(Operation operation) throws ApiException
operation
- the operation object.ApiException
- if the new operation could not be added.Resource deleteOperation(java.lang.String name) throws ApiException
name
- the name of the operation.ApiException
- if the existing operation could not be deleted.java.lang.String getDescription()
Resource setDescription(java.lang.String description) throws ApiException
description
- the new description of this resource.ApiException
- if the description could not be changed.