@PublicApi public class SpacePropertyResource extends Object
A REST resource for manipulating space properties.
Space properties are a key / value store of properties attached to a Space. The key is a string, and the value is a JSON object.
Constructor and Description |
---|
SpacePropertyResource(SpacePropertyService service) |
Modifier and Type | Method and Description |
---|---|
JsonSpaceProperty |
create(String spaceKey,
JsonSpaceProperty newProperty)
Creates a new space property.
|
JsonSpaceProperty |
create(String spaceKey,
String propertyKey,
JsonSpaceProperty newProperty)
Creates a new space property.
|
javax.ws.rs.core.Response |
delete(String spaceKey,
String propertyKey)
Deletes a space property.
|
PageResponse<JsonSpaceProperty> |
get(String spaceKey,
String expand,
int start,
int limit,
javax.ws.rs.core.UriInfo uriInfo)
Returns a paginated list of space properties.
|
JsonSpaceProperty |
get(String spaceKey,
String propertyKey,
String expand)
Returns a space property.
|
JsonSpaceProperty |
update(String spaceKey,
String propertyKey,
JsonSpaceProperty property)
Updates a space property.
|
public SpacePropertyResource(SpacePropertyService service)
public JsonSpaceProperty create(String spaceKey, JsonSpaceProperty newProperty) throws ServiceException
Creates a new space property.
spaceKey
- the space to attach the property tonewProperty
- space property to be createdServiceException
public JsonSpaceProperty create(String spaceKey, String propertyKey, JsonSpaceProperty newProperty) throws ServiceException
Creates a new space property.
spaceKey
- the space to attach the property topropertyKey
- property key of the property to be creatednewProperty
- space property to be createdServiceException
public PageResponse<JsonSpaceProperty> get(String spaceKey, String expand, int start, int limit, @Context javax.ws.rs.core.UriInfo uriInfo) throws ServiceException
Returns a paginated list of space properties.
Example request URI:
http://example.com/confluence/rest/api/space/TST/property?expand=space,version
spaceKey
- the space to find properties under. Required.expand
- a comma separated list of properties to expand on the space properties. Default value: version
.start
- the start point of the collection to returnlimit
- the limit of the number of items to return, this may be restricted by fixed system limitsuriInfo
- (injected) information about the request URIServiceException
public JsonSpaceProperty get(String spaceKey, String propertyKey, String expand) throws ServiceException
Returns a space property.
Example request URI:
http://example.com/confluence/rest/api/space/TST/property/example-property-key?expand=space,version
spaceKey
- the space to find the property under. Required.propertyKey
- the key of the space property. Required.expand
- a comma separated list of properties to expand on the space properties. Default value: version
.ServiceException
public JsonSpaceProperty update(String spaceKey, String propertyKey, JsonSpaceProperty property) throws ServiceException
Updates a space property.
The body contains the representation of the space property. Must include new version number.
If the given version number is 1, attempts to create a new space property, just like create(String, com.atlassian.confluence.api.model.content.JsonSpaceProperty)
.
spaceKey
- the space to attach the property topropertyKey
- the key of the propertyproperty
- the space property being updatedServiceException
- if there is no space with the given spaceKey, or no property with the given key, or if the user is not permitted.public javax.ws.rs.core.Response delete(String spaceKey, String propertyKey) throws ServiceException
Deletes a space property.
spaceKey
- the key of the spacepropertyKey
- the key of the propertyServiceException
Copyright © 2003–2019 Atlassian. All rights reserved.