fi.metatavu.dcfb.client.ItemsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dcfb-api-client Show documentation
Show all versions of dcfb-api-client Show documentation
Metaform API specifications
package fi.metatavu.dcfb.client;
import fi.metatavu.dcfb.ApiClient;
import fi.metatavu.dcfb.EncodingUtils;
import fi.metatavu.dcfb.client.BadRequest;
import fi.metatavu.dcfb.client.Forbidden;
import fi.metatavu.dcfb.client.InternalServerError;
import fi.metatavu.dcfb.client.Item;
import fi.metatavu.dcfb.client.ItemReservation;
import java.util.UUID;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import feign.*;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-09-11T15:10:38.040+03:00")
public interface ItemsApi extends ApiClient.Api {
/**
* Create item
* Create item
* @param payload Payload (required)
* @return Item
*/
@RequestLine("POST /items")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
Item createItem(Item payload);
/**
* Create item
* Create item
* @param itemId Item id (required)
* @param payload Payload (required)
* @return ItemReservation
*/
@RequestLine("POST /items/{itemId}/reservations")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
ItemReservation createItemReservation(@Param("itemId") UUID itemId, ItemReservation payload);
/**
* deletes an item
* Delete item
* @param itemId Item id (required)
*/
@RequestLine("DELETE /items/{itemId}")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
void deleteItem(@Param("itemId") UUID itemId);
/**
* Finds an item
* Find item
* @param itemId Item id (required)
* @return Item
*/
@RequestLine("GET /items/{itemId}")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
Item findItem(@Param("itemId") UUID itemId);
/**
* List items
* List items
* @param categoryIds Filter by category ids (comma delimitered) (optional)
* @param locationIds Filter by location ids (comma delimitered) (optional)
* @param userIds Filter by user ids (comma delimitered) (optional)
* @param search Search by free-text query (optional)
* @param nearLat Prefer results near geo-point (optional)
* @param nearLon Prefer results near geo-point (optional)
* @param sort (optional)
* @param firstResult First result (optional)
* @param maxResults Max results (optional)
* @return List<Item>
*/
@RequestLine("GET /items?categoryIds={categoryIds}&locationIds={locationIds}&userIds={userIds}&search={search}&nearLat={nearLat}&nearLon={nearLon}&sort={sort}&firstResult={firstResult}&maxResults={maxResults}")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
List- listItems(@Param("categoryIds") String categoryIds, @Param("locationIds") String locationIds, @Param("userIds") String userIds, @Param("search") String search, @Param("nearLat") Double nearLat, @Param("nearLon") Double nearLon, @Param("sort") List
sort, @Param("firstResult") Long firstResult, @Param("maxResults") Long maxResults);
/**
* List items
* List items
* Note, this is equivalent to the other listItems
method,
* but with the query parameters collected into a single Map parameter. This
* is convenient for services with optional query parameters, especially when
* used with the {@link ListItemsQueryParams} class that allows for
* building up this map in a fluent style.
* @param queryParams Map of query parameters as name-value pairs
* The following elements may be specified in the query map:
*
* - categoryIds - Filter by category ids (comma delimitered) (optional)
* - locationIds - Filter by location ids (comma delimitered) (optional)
* - userIds - Filter by user ids (comma delimitered) (optional)
* - search - Search by free-text query (optional)
* - nearLat - Prefer results near geo-point (optional)
* - nearLon - Prefer results near geo-point (optional)
* - sort - (optional)
* - firstResult - First result (optional)
* - maxResults - Max results (optional)
*
* @return List<Item>
*/
@RequestLine("GET /items?categoryIds={categoryIds}&locationIds={locationIds}&userIds={userIds}&search={search}&nearLat={nearLat}&nearLon={nearLon}&sort={sort}&firstResult={firstResult}&maxResults={maxResults}")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
List- listItems(@QueryMap(encoded=true) Map
queryParams);
/**
* A convenience class for generating query parameters for the
* listItems
method in a fluent style.
*/
public static class ListItemsQueryParams extends HashMap {
public ListItemsQueryParams categoryIds(final String value) {
put("categoryIds", EncodingUtils.encode(value));
return this;
}
public ListItemsQueryParams locationIds(final String value) {
put("locationIds", EncodingUtils.encode(value));
return this;
}
public ListItemsQueryParams userIds(final String value) {
put("userIds", EncodingUtils.encode(value));
return this;
}
public ListItemsQueryParams search(final String value) {
put("search", EncodingUtils.encode(value));
return this;
}
public ListItemsQueryParams nearLat(final Double value) {
put("nearLat", EncodingUtils.encode(value));
return this;
}
public ListItemsQueryParams nearLon(final Double value) {
put("nearLon", EncodingUtils.encode(value));
return this;
}
public ListItemsQueryParams sort(final List value) {
put("sort", EncodingUtils.encodeCollection(value, "csv"));
return this;
}
public ListItemsQueryParams firstResult(final Long value) {
put("firstResult", EncodingUtils.encode(value));
return this;
}
public ListItemsQueryParams maxResults(final Long value) {
put("maxResults", EncodingUtils.encode(value));
return this;
}
}
/**
* updates an item
* Update item
* @param itemId Item id (required)
* @param payload Payload (required)
* @return Item
*/
@RequestLine("PUT /items/{itemId}")
@Headers({
"Content-Type: application/json",
"Accept: application/json",
})
Item updateItem(@Param("itemId") UUID itemId, Item payload);
}