OpenPricesAPIClient class
Client calls of the Open Prices API.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createPrice(
{required Price price, required String bearerToken, UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< Price?> > - Adds a price. Returns an error, or either the added price or null.
-
deletePrice(
{required int priceId, UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) → Future< MaybeError< bool> > - Deletes a price. A user can delete only owned prices. Returns true if successful.
-
deleteProof(
{required int proofId, UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) → Future< MaybeError< bool> > - Deletes a proof.
-
deleteUserSession(
{UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) → Future< MaybeError< bool> > - Deletes a user session.
-
getAuthenticationToken(
{required String username, required String password, bool setCookie = false, UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< String> > - Authentication: provide username/password and get a bearer token in return.
-
getLocation(
int locationId, {UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< Location> > -
getLocations(
GetLocationsParameters parameters, {UriProductHelper uriHelper = uriHelperFoodProd, String? bearerToken}) → Future< MaybeError< GetLocationsResult> > -
getOSMLocation(
{required int locationOSMId, required LocationOSMType locationOSMType, UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< Location> > -
getPrice(
int priceId, {UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< Price> > - Gets a price.
-
getPriceProductByCode(
String productCode, {UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< PriceProduct> > -
getPriceProductById(
int productId, {UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< PriceProduct> > -
getPriceProducts(
GetPriceProductsParameters parameters, {UriProductHelper uriHelper = uriHelperFoodProd, String? bearerToken}) → Future< MaybeError< GetPriceProductsResult> > -
getPrices(
GetPricesParameters parameters, {UriProductHelper uriHelper = uriHelperFoodProd, String? bearerToken}) → Future< MaybeError< GetPricesResult> > -
getProof(
int proofId, {UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) → Future< MaybeError< Proof> > - Get user proof by id.
-
getProofs(
GetProofsParameters parameters, {UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) → Future< MaybeError< GetProofsResult> > - Get user proofs.
-
getStats(
{UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< PriceTotalStats> > - Returns the total stats.
-
getStatus(
{UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< String> > - Returns the status of the server.
-
getUri(
{required String path, Map< String, dynamic> ? queryParameters, UriProductHelper uriHelper = uriHelperFoodProd, bool? addUserAgentParameters}) → Uri -
getUser(
String username, {UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< PriceUser> > -
getUsers(
GetUsersParameters parameters, {UriProductHelper uriHelper = uriHelperFoodProd, String? bearerToken}) → Future< MaybeError< GetUsersResult> > -
getUserSession(
{UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) → Future< MaybeError< Session> > -
Returns the session details related to this
bearerToken
. -
updatePrice(
int priceId, {required UpdatePriceParameters parameters, UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) → Future< MaybeError< bool> > - Updates a price.
-
updateProof(
int proofId, {required UpdateProofParameters parameters, UriProductHelper uriHelper = uriHelperFoodProd, required String bearerToken}) → Future< MaybeError< bool> > - Updates a proof.
-
uploadProof(
{ProofType? proofType, required Uri imageUri, required dynamic mediaType, CreateProofParameters? createProofParameters, int? locationOSMId, LocationOSMType? locationOSMType, DateTime? date, Currency? currency, int? receiptPriceCount, num? receiptPriceTotal, required String bearerToken, UriProductHelper uriHelper = uriHelperFoodProd}) → Future< MaybeError< Proof> >
Constants
- statusRunning → const String
- Status when the server is running (cf. getStatus).