diff --git a/lib/api.dart b/lib/api.dart new file mode 100644 index 0000000..f87813c --- /dev/null +++ b/lib/api.dart @@ -0,0 +1,84 @@ +library api; + +import 'dart:async'; +import 'dart:convert'; +import 'dart:html'; +import 'package:http/browser_client.dart'; +import 'package:http/http.dart'; +import 'package:dartson/dartson.dart'; +import 'package:crypto/crypto.dart'; +import 'package:intl/intl.dart'; + +part 'api_client.dart'; +part 'api_exception.dart'; +part 'auth/authentication.dart'; +part 'auth/api_key_auth.dart'; +part 'auth/oauth.dart'; +part 'auth/http_basic_auth.dart'; + +part 'api/variableUserSource_api.dart'; +part 'api/measurement_api.dart'; +part 'api/variable_api.dart'; +part 'api/update_api.dart'; +part 'api/aggregatedCorrelation_api.dart'; +part 'api/connector_api.dart'; +part 'api/correlation_api.dart'; +part 'api/connection_api.dart'; +part 'api/unit_api.dart'; +part 'api/userVariable_api.dart'; +part 'api/source_api.dart'; +part 'api/variableCategory_api.dart'; +part 'api/credential_api.dart'; +part 'api/unitCategory_api.dart'; +part 'api/vote_api.dart'; + +part 'model/measurementValue.dart'; +part 'model/measurementPost.dart'; +part 'model/aggregatedCorrelation.dart'; +part 'model/connection.dart'; +part 'model/connector.dart'; +part 'model/correlation.dart'; +part 'model/credential.dart'; +part 'model/measurement.dart'; +part 'model/measurementExport.dart'; +part 'model/source.dart'; +part 'model/unit.dart'; +part 'model/unitCategory.dart'; +part 'model/unitConversion.dart'; +part 'model/update.dart'; +part 'model/userVariable.dart'; +part 'model/variable.dart'; +part 'model/variableCategory.dart'; +part 'model/variableUserSource.dart'; +part 'model/vote.dart'; +part 'model/inlineResponse200.dart'; +part 'model/inlineResponse2001.dart'; +part 'model/inlineResponse2002.dart'; +part 'model/inlineResponse2003.dart'; +part 'model/inlineResponse2004.dart'; +part 'model/inlineResponse2005.dart'; +part 'model/inlineResponse2006.dart'; +part 'model/inlineResponse2007.dart'; +part 'model/inlineResponse2008.dart'; +part 'model/inlineResponse2009.dart'; +part 'model/inlineResponse20010.dart'; +part 'model/inlineResponse20011.dart'; +part 'model/inlineResponse20012.dart'; +part 'model/inlineResponse20013.dart'; +part 'model/inlineResponse20014.dart'; +part 'model/inlineResponse20015.dart'; +part 'model/inlineResponse20016.dart'; +part 'model/inlineResponse20017.dart'; +part 'model/inlineResponse20018.dart'; +part 'model/inlineResponse20019.dart'; +part 'model/inlineResponse20020.dart'; +part 'model/inlineResponse20021.dart'; +part 'model/inlineResponse20022.dart'; +part 'model/inlineResponse20023.dart'; +part 'model/inlineResponse20024.dart'; +part 'model/inlineResponse20025.dart'; +part 'model/inlineResponse20026.dart'; +part 'model/inlineResponse20027.dart'; +part 'model/inlineResponse20028.dart'; +part 'model/inlineResponse20029.dart'; +part 'model/inlineResponse20030.dart'; diff --git a/lib/api/aggregated_correlation_api.dart b/lib/api/aggregated_correlation_api.dart new file mode 100644 index 0000000..e0122f9 --- /dev/null +++ b/lib/api/aggregated_correlation_api.dart @@ -0,0 +1,301 @@ +part of api; + + +class AggregatedCorrelationApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + AggregatedCorrelationApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all AggregatedCorrelations + /// + /// Get all AggregatedCorrelations + Future aggregatedCorrelationsGet(Number correlation, int causeId, int effectId, int onsetDelay, int durationOfAction, int numberOfPairs, Number valuePredictingHighOutcome, Number valuePredictingLowOutcome, Number optimalPearsonProduct, Number vote, int numberOfUsers, int numberOfCorrelations, Number statisticalSignificance, String causeUnit, int causeUnitId, int causeChanges, int effectChanges, Number aggregateQmScore, String createdAt, String updatedAt, String status, String errorMessage, String lastSuccessfulUpdateTime, Number reversePearsonCorrelationCoefficient, Number predictivePearsonCorrelationCoefficient, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/aggregatedCorrelations".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != correlation) + queryParams["correlation"] = correlation is List ? correlation.join(',') : correlation; + if("null" != causeId) + queryParams["cause_id"] = causeId is List ? causeId.join(',') : causeId; + if("null" != effectId) + queryParams["effect_id"] = effectId is List ? effectId.join(',') : effectId; + if("null" != onsetDelay) + queryParams["onset_delay"] = onsetDelay is List ? onsetDelay.join(',') : onsetDelay; + if("null" != durationOfAction) + queryParams["duration_of_action"] = durationOfAction is List ? durationOfAction.join(',') : durationOfAction; + if("null" != numberOfPairs) + queryParams["number_of_pairs"] = numberOfPairs is List ? numberOfPairs.join(',') : numberOfPairs; + if("null" != valuePredictingHighOutcome) + queryParams["value_predicting_high_outcome"] = valuePredictingHighOutcome is List ? valuePredictingHighOutcome.join(',') : valuePredictingHighOutcome; + if("null" != valuePredictingLowOutcome) + queryParams["value_predicting_low_outcome"] = valuePredictingLowOutcome is List ? valuePredictingLowOutcome.join(',') : valuePredictingLowOutcome; + if("null" != optimalPearsonProduct) + queryParams["optimal_pearson_product"] = optimalPearsonProduct is List ? optimalPearsonProduct.join(',') : optimalPearsonProduct; + if("null" != vote) + queryParams["vote"] = vote is List ? vote.join(',') : vote; + if("null" != numberOfUsers) + queryParams["number_of_users"] = numberOfUsers is List ? numberOfUsers.join(',') : numberOfUsers; + if("null" != numberOfCorrelations) + queryParams["number_of_correlations"] = numberOfCorrelations is List ? numberOfCorrelations.join(',') : numberOfCorrelations; + if("null" != statisticalSignificance) + queryParams["statistical_significance"] = statisticalSignificance is List ? statisticalSignificance.join(',') : statisticalSignificance; + if("null" != causeUnit) + queryParams["cause_unit"] = causeUnit is List ? causeUnit.join(',') : causeUnit; + if("null" != causeUnitId) + queryParams["cause_unit_id"] = causeUnitId is List ? causeUnitId.join(',') : causeUnitId; + if("null" != causeChanges) + queryParams["cause_changes"] = causeChanges is List ? causeChanges.join(',') : causeChanges; + if("null" != effectChanges) + queryParams["effect_changes"] = effectChanges is List ? effectChanges.join(',') : effectChanges; + if("null" != aggregateQmScore) + queryParams["aggregate_qm_score"] = aggregateQmScore is List ? aggregateQmScore.join(',') : aggregateQmScore; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != status) + queryParams["status"] = status is List ? status.join(',') : status; + if("null" != errorMessage) + queryParams["error_message"] = errorMessage is List ? errorMessage.join(',') : errorMessage; + if("null" != lastSuccessfulUpdateTime) + queryParams["last_successful_update_time"] = lastSuccessfulUpdateTime is List ? lastSuccessfulUpdateTime.join(',') : lastSuccessfulUpdateTime; + if("null" != reversePearsonCorrelationCoefficient) + queryParams["reverse_pearson_correlation_coefficient"] = reversePearsonCorrelationCoefficient is List ? reversePearsonCorrelationCoefficient.join(',') : reversePearsonCorrelationCoefficient; + if("null" != predictivePearsonCorrelationCoefficient) + queryParams["predictive_pearson_correlation_coefficient"] = predictivePearsonCorrelationCoefficient is List ? predictivePearsonCorrelationCoefficient.join(',') : predictivePearsonCorrelationCoefficient; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse200); + } + else { + return null; + } + }); + } + + /// Store AggregatedCorrelation + /// + /// Store AggregatedCorrelation + Future aggregatedCorrelationsPost(AggregatedCorrelation body) { + Object postBody = body; + + + // create path and map variables + String path = "/aggregatedCorrelations".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2001); + } + else { + return null; + } + }); + } + + /// Get AggregatedCorrelation + /// + /// Get AggregatedCorrelation + Future aggregatedCorrelationsIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/aggregatedCorrelations/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2001); + } + else { + return null; + } + }); + } + + /// Update AggregatedCorrelation + /// + /// Update AggregatedCorrelation + Future aggregatedCorrelationsIdPut(int id, AggregatedCorrelation body) { + Object postBody = body; + + + // create path and map variables + String path = "/aggregatedCorrelations/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete AggregatedCorrelation + /// + /// Delete AggregatedCorrelation + Future aggregatedCorrelationsIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/aggregatedCorrelations/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/connection_api.dart b/lib/api/connection_api.dart new file mode 100644 index 0000000..b1f3610 --- /dev/null +++ b/lib/api/connection_api.dart @@ -0,0 +1,271 @@ +part of api; + + +class ConnectionApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + ConnectionApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Connections + /// + /// Get all Connections + Future connectionsGet(int userId, int connectorId, String connectStatus, String connectError, String updateRequestedAt, String updateStatus, String updateError, String lastSuccessfulUpdatedAt, String createdAt, String updatedAt, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/connections".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != userId) + queryParams["user_id"] = userId is List ? userId.join(',') : userId; + if("null" != connectorId) + queryParams["connector_id"] = connectorId is List ? connectorId.join(',') : connectorId; + if("null" != connectStatus) + queryParams["connect_status"] = connectStatus is List ? connectStatus.join(',') : connectStatus; + if("null" != connectError) + queryParams["connect_error"] = connectError is List ? connectError.join(',') : connectError; + if("null" != updateRequestedAt) + queryParams["update_requested_at"] = updateRequestedAt is List ? updateRequestedAt.join(',') : updateRequestedAt; + if("null" != updateStatus) + queryParams["update_status"] = updateStatus is List ? updateStatus.join(',') : updateStatus; + if("null" != updateError) + queryParams["update_error"] = updateError is List ? updateError.join(',') : updateError; + if("null" != lastSuccessfulUpdatedAt) + queryParams["last_successful_updated_at"] = lastSuccessfulUpdatedAt is List ? lastSuccessfulUpdatedAt.join(',') : lastSuccessfulUpdatedAt; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = ["quantimodo_oauth2"]; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2003); + } + else { + return null; + } + }); + } + + /// Store Connection + /// + /// Store Connection + Future connectionsPost(Connection body) { + Object postBody = body; + + + // create path and map variables + String path = "/connections".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = ["quantimodo_oauth2"]; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2004); + } + else { + return null; + } + }); + } + + /// Get Connection + /// + /// Get Connection + Future connectionsIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/connections/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = ["quantimodo_oauth2"]; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2004); + } + else { + return null; + } + }); + } + + /// Update Connection + /// + /// Update Connection + Future connectionsIdPut(int id, Connection body) { + Object postBody = body; + + + // create path and map variables + String path = "/connections/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = ["quantimodo_oauth2"]; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Connection + /// + /// Delete Connection + Future connectionsIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/connections/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = ["quantimodo_oauth2"]; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/connector_api.dart b/lib/api/connector_api.dart new file mode 100644 index 0000000..2da6ccc --- /dev/null +++ b/lib/api/connector_api.dart @@ -0,0 +1,267 @@ +part of api; + + +class ConnectorApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + ConnectorApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Connectors + /// + /// Get all Connectors + Future connectorsGet(String name, String displayName, String image, String getItUrl, String shortDescription, String longDescription, bool enabled, bool oauth, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/connectors".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != name) + queryParams["name"] = name is List ? name.join(',') : name; + if("null" != displayName) + queryParams["display_name"] = displayName is List ? displayName.join(',') : displayName; + if("null" != image) + queryParams["image"] = image is List ? image.join(',') : image; + if("null" != getItUrl) + queryParams["get_it_url"] = getItUrl is List ? getItUrl.join(',') : getItUrl; + if("null" != shortDescription) + queryParams["short_description"] = shortDescription is List ? shortDescription.join(',') : shortDescription; + if("null" != longDescription) + queryParams["long_description"] = longDescription is List ? longDescription.join(',') : longDescription; + if("null" != enabled) + queryParams["enabled"] = enabled is List ? enabled.join(',') : enabled; + if("null" != oauth) + queryParams["oauth"] = oauth is List ? oauth.join(',') : oauth; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2005); + } + else { + return null; + } + }); + } + + /// Store Connector + /// + /// Store Connector + Future connectorsPost(Connector body) { + Object postBody = body; + + + // create path and map variables + String path = "/connectors".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2006); + } + else { + return null; + } + }); + } + + /// Get Connector + /// + /// Get Connector + Future connectorsIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/connectors/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2006); + } + else { + return null; + } + }); + } + + /// Update Connector + /// + /// Update Connector + Future connectorsIdPut(int id, Connector body) { + Object postBody = body; + + + // create path and map variables + String path = "/connectors/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Connector + /// + /// Delete Connector + Future connectorsIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/connectors/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/correlation_api.dart b/lib/api/correlation_api.dart new file mode 100644 index 0000000..c2b5df2 --- /dev/null +++ b/lib/api/correlation_api.dart @@ -0,0 +1,297 @@ +part of api; + + +class CorrelationApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + CorrelationApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Correlations + /// + /// Get all Correlations + Future correlationsGet(int timestamp, int userId, Number correlation, int causeId, int effectId, int onsetDelay, int durationOfAction, int numberOfPairs, Number valuePredictingHighOutcome, Number valuePredictingLowOutcome, Number optimalPearsonProduct, Number vote, Number statisticalSignificance, String causeUnit, int causeUnitId, int causeChanges, int effectChanges, Number qmScore, String error, String createdAt, String updatedAt, Number reversePearsonCorrelationCoefficient, Number predictivePearsonCorrelationCoefficient, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/correlations".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != timestamp) + queryParams["timestamp"] = timestamp is List ? timestamp.join(',') : timestamp; + if("null" != userId) + queryParams["user_id"] = userId is List ? userId.join(',') : userId; + if("null" != correlation) + queryParams["correlation"] = correlation is List ? correlation.join(',') : correlation; + if("null" != causeId) + queryParams["cause_id"] = causeId is List ? causeId.join(',') : causeId; + if("null" != effectId) + queryParams["effect_id"] = effectId is List ? effectId.join(',') : effectId; + if("null" != onsetDelay) + queryParams["onset_delay"] = onsetDelay is List ? onsetDelay.join(',') : onsetDelay; + if("null" != durationOfAction) + queryParams["duration_of_action"] = durationOfAction is List ? durationOfAction.join(',') : durationOfAction; + if("null" != numberOfPairs) + queryParams["number_of_pairs"] = numberOfPairs is List ? numberOfPairs.join(',') : numberOfPairs; + if("null" != valuePredictingHighOutcome) + queryParams["value_predicting_high_outcome"] = valuePredictingHighOutcome is List ? valuePredictingHighOutcome.join(',') : valuePredictingHighOutcome; + if("null" != valuePredictingLowOutcome) + queryParams["value_predicting_low_outcome"] = valuePredictingLowOutcome is List ? valuePredictingLowOutcome.join(',') : valuePredictingLowOutcome; + if("null" != optimalPearsonProduct) + queryParams["optimal_pearson_product"] = optimalPearsonProduct is List ? optimalPearsonProduct.join(',') : optimalPearsonProduct; + if("null" != vote) + queryParams["vote"] = vote is List ? vote.join(',') : vote; + if("null" != statisticalSignificance) + queryParams["statistical_significance"] = statisticalSignificance is List ? statisticalSignificance.join(',') : statisticalSignificance; + if("null" != causeUnit) + queryParams["cause_unit"] = causeUnit is List ? causeUnit.join(',') : causeUnit; + if("null" != causeUnitId) + queryParams["cause_unit_id"] = causeUnitId is List ? causeUnitId.join(',') : causeUnitId; + if("null" != causeChanges) + queryParams["cause_changes"] = causeChanges is List ? causeChanges.join(',') : causeChanges; + if("null" != effectChanges) + queryParams["effect_changes"] = effectChanges is List ? effectChanges.join(',') : effectChanges; + if("null" != qmScore) + queryParams["qm_score"] = qmScore is List ? qmScore.join(',') : qmScore; + if("null" != error) + queryParams["error"] = error is List ? error.join(',') : error; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != reversePearsonCorrelationCoefficient) + queryParams["reverse_pearson_correlation_coefficient"] = reversePearsonCorrelationCoefficient is List ? reversePearsonCorrelationCoefficient.join(',') : reversePearsonCorrelationCoefficient; + if("null" != predictivePearsonCorrelationCoefficient) + queryParams["predictive_pearson_correlation_coefficient"] = predictivePearsonCorrelationCoefficient is List ? predictivePearsonCorrelationCoefficient.join(',') : predictivePearsonCorrelationCoefficient; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2007); + } + else { + return null; + } + }); + } + + /// Store Correlation + /// + /// Store Correlation + Future correlationsPost(Correlation body) { + Object postBody = body; + + + // create path and map variables + String path = "/correlations".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2008); + } + else { + return null; + } + }); + } + + /// Get Correlation + /// + /// Get Correlation + Future correlationsIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/correlations/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2008); + } + else { + return null; + } + }); + } + + /// Update Correlation + /// + /// Update Correlation + Future correlationsIdPut(int id, Correlation body) { + Object postBody = body; + + + // create path and map variables + String path = "/correlations/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Correlation + /// + /// Delete Correlation + Future correlationsIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/correlations/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/credential_api.dart b/lib/api/credential_api.dart new file mode 100644 index 0000000..b962efb --- /dev/null +++ b/lib/api/credential_api.dart @@ -0,0 +1,267 @@ +part of api; + + +class CredentialApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + CredentialApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Credentials + /// + /// Get all Credentials + Future credentialsGet(bool connectorId, String attrKey, String attrValue, String createdAt, String updatedAt, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/credentials".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != connectorId) + queryParams["connector_id"] = connectorId is List ? connectorId.join(',') : connectorId; + if("null" != attrKey) + queryParams["attr_key"] = attrKey is List ? attrKey.join(',') : attrKey; + if("null" != attrValue) + queryParams["attr_value"] = attrValue is List ? attrValue.join(',') : attrValue; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2009); + } + else { + return null; + } + }); + } + + /// Store Credential + /// + /// Store Credential + Future credentialsPost(Credential body) { + Object postBody = body; + + + // create path and map variables + String path = "/credentials".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20010); + } + else { + return null; + } + }); + } + + /// Get Credential + /// + /// Get Credential + Future credentialsIdGet(int id, String attrKey) { + Object postBody = null; + + + // create path and map variables + String path = "/credentials/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != attrKey) + queryParams["attrKey"] = attrKey is List ? attrKey.join(',') : attrKey; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20010); + } + else { + return null; + } + }); + } + + /// Update Credential + /// + /// Update Credential + Future credentialsIdPut(int id, String attrKey, Credential body) { + Object postBody = body; + + + // create path and map variables + String path = "/credentials/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != attrKey) + queryParams["attrKey"] = attrKey is List ? attrKey.join(',') : attrKey; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Credential + /// + /// Delete Credential + Future credentialsIdDelete(int id, String attrKey) { + Object postBody = null; + + + // create path and map variables + String path = "/credentials/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != attrKey) + queryParams["attrKey"] = attrKey is List ? attrKey.join(',') : attrKey; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/measurement_api.dart b/lib/api/measurement_api.dart new file mode 100644 index 0000000..ce93b37 --- /dev/null +++ b/lib/api/measurement_api.dart @@ -0,0 +1,373 @@ +part of api; + + +class MeasurementApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + MeasurementApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Measurements + /// + /// Get all Measurements + Future measurementsGet(int userId, String clientId, int connectorId, int variableId, int startTime, Number value, Number originalValue, int duration, String note, Number latitude, Number longitude, String location, String createdAt, String updatedAt, String error, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/measurements".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != userId) + queryParams["user_id"] = userId is List ? userId.join(',') : userId; + if("null" != clientId) + queryParams["client_id"] = clientId is List ? clientId.join(',') : clientId; + if("null" != connectorId) + queryParams["connector_id"] = connectorId is List ? connectorId.join(',') : connectorId; + if("null" != variableId) + queryParams["variable_id"] = variableId is List ? variableId.join(',') : variableId; + if("null" != startTime) + queryParams["start_time"] = startTime is List ? startTime.join(',') : startTime; + if("null" != value) + queryParams["value"] = value is List ? value.join(',') : value; + if("null" != originalValue) + queryParams["original_value"] = originalValue is List ? originalValue.join(',') : originalValue; + if("null" != duration) + queryParams["duration"] = duration is List ? duration.join(',') : duration; + if("null" != note) + queryParams["note"] = note is List ? note.join(',') : note; + if("null" != latitude) + queryParams["latitude"] = latitude is List ? latitude.join(',') : latitude; + if("null" != longitude) + queryParams["longitude"] = longitude is List ? longitude.join(',') : longitude; + if("null" != location) + queryParams["location"] = location is List ? location.join(',') : location; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != error) + queryParams["error"] = error is List ? error.join(',') : error; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20011); + } + else { + return null; + } + }); + } + + /// Store Measurement + /// + /// Store Measurement + Future measurementsPost(MeasurementPost body) { + Object postBody = body; + + + // create path and map variables + String path = "/measurements".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20011); + } + else { + return null; + } + }); + } + + /// Get Measurements CSV + /// + /// Get Measurements CSV + Future measurementsCsvGet() { + Object postBody = null; + + + // create path and map variables + String path = "/measurements/csv".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, File); + } + else { + return null; + } + }); + } + + /// Post Request for Measurements CSV + /// + /// Post Request for Measurements CSV + Future measurementsRequestCsvPost() { + Object postBody = null; + + + // create path and map variables + String path = "/measurements/request_csv".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, int); + } + else { + return null; + } + }); + } + + /// Get Measurement + /// + /// Get Measurement + Future measurementsIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/measurements/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20012); + } + else { + return null; + } + }); + } + + /// Update Measurement + /// + /// Update Measurement + Future measurementsIdPut(int id, Measurement body) { + Object postBody = body; + + + // create path and map variables + String path = "/measurements/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Measurement + /// + /// Delete Measurement + Future measurementsIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/measurements/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/source_api.dart b/lib/api/source_api.dart new file mode 100644 index 0000000..2fafc65 --- /dev/null +++ b/lib/api/source_api.dart @@ -0,0 +1,259 @@ +part of api; + + +class SourceApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + SourceApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Sources + /// + /// Get all Sources + Future sourcesGet(String clientId, String name, String createdAt, String updatedAt, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/sources".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != clientId) + queryParams["client_id"] = clientId is List ? clientId.join(',') : clientId; + if("null" != name) + queryParams["name"] = name is List ? name.join(',') : name; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20013); + } + else { + return null; + } + }); + } + + /// Store Source + /// + /// Store Source + Future sourcesPost(Source body) { + Object postBody = body; + + + // create path and map variables + String path = "/sources".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20014); + } + else { + return null; + } + }); + } + + /// Get Source + /// + /// Get Source + Future sourcesIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/sources/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20014); + } + else { + return null; + } + }); + } + + /// Update Source + /// + /// Update Source + Future sourcesIdPut(int id, Source body) { + Object postBody = body; + + + // create path and map variables + String path = "/sources/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Source + /// + /// Delete Source + Future sourcesIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/sources/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/unit_api.dart b/lib/api/unit_api.dart new file mode 100644 index 0000000..4f1381c --- /dev/null +++ b/lib/api/unit_api.dart @@ -0,0 +1,273 @@ +part of api; + + +class UnitApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + UnitApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Units + /// + /// Get all Units + Future unitsGet(String clientId, String name, String abbreviatedName, bool categoryId, Number minimumValue, Number maximumValue, int updated, Number multiply, Number add, String createdAt, String updatedAt, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/units".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != clientId) + queryParams["client_id"] = clientId is List ? clientId.join(',') : clientId; + if("null" != name) + queryParams["name"] = name is List ? name.join(',') : name; + if("null" != abbreviatedName) + queryParams["abbreviated_name"] = abbreviatedName is List ? abbreviatedName.join(',') : abbreviatedName; + if("null" != categoryId) + queryParams["category_id"] = categoryId is List ? categoryId.join(',') : categoryId; + if("null" != minimumValue) + queryParams["minimum_value"] = minimumValue is List ? minimumValue.join(',') : minimumValue; + if("null" != maximumValue) + queryParams["maximum_value"] = maximumValue is List ? maximumValue.join(',') : maximumValue; + if("null" != updated) + queryParams["updated"] = updated is List ? updated.join(',') : updated; + if("null" != multiply) + queryParams["multiply"] = multiply is List ? multiply.join(',') : multiply; + if("null" != add) + queryParams["add"] = add is List ? add.join(',') : add; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20017); + } + else { + return null; + } + }); + } + + /// Store Unit + /// + /// Store Unit + Future unitsPost(Unit body) { + Object postBody = body; + + + // create path and map variables + String path = "/units".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20018); + } + else { + return null; + } + }); + } + + /// Get Unit + /// + /// Get Unit + Future unitsIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/units/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20018); + } + else { + return null; + } + }); + } + + /// Update Unit + /// + /// Update Unit + Future unitsIdPut(int id, Unit body) { + Object postBody = body; + + + // create path and map variables + String path = "/units/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Unit + /// + /// Delete Unit + Future unitsIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/units/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/unit_category_api.dart b/lib/api/unit_category_api.dart new file mode 100644 index 0000000..31babee --- /dev/null +++ b/lib/api/unit_category_api.dart @@ -0,0 +1,257 @@ +part of api; + + +class UnitCategoryApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + UnitCategoryApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all UnitCategories + /// + /// Get all UnitCategories + Future unitCategoriesGet(String name, String createdAt, String updatedAt, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/unitCategories".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != name) + queryParams["name"] = name is List ? name.join(',') : name; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20015); + } + else { + return null; + } + }); + } + + /// Store UnitCategory + /// + /// Store UnitCategory + Future unitCategoriesPost(UnitCategory body) { + Object postBody = body; + + + // create path and map variables + String path = "/unitCategories".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20016); + } + else { + return null; + } + }); + } + + /// Get UnitCategory + /// + /// Get UnitCategory + Future unitCategoriesIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/unitCategories/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20016); + } + else { + return null; + } + }); + } + + /// Update UnitCategory + /// + /// Update UnitCategory + Future unitCategoriesIdPut(int id, UnitCategory body) { + Object postBody = body; + + + // create path and map variables + String path = "/unitCategories/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete UnitCategory + /// + /// Delete UnitCategory + Future unitCategoriesIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/unitCategories/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/update_api.dart b/lib/api/update_api.dart new file mode 100644 index 0000000..3a83836 --- /dev/null +++ b/lib/api/update_api.dart @@ -0,0 +1,265 @@ +part of api; + + +class UpdateApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + UpdateApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Updates + /// + /// Get all Updates + Future updatesGet(int userId, int connectorId, int numberOfMeasurements, bool success, String message, String createdAt, String updatedAt, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/updates".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != userId) + queryParams["user_id"] = userId is List ? userId.join(',') : userId; + if("null" != connectorId) + queryParams["connector_id"] = connectorId is List ? connectorId.join(',') : connectorId; + if("null" != numberOfMeasurements) + queryParams["number_of_measurements"] = numberOfMeasurements is List ? numberOfMeasurements.join(',') : numberOfMeasurements; + if("null" != success) + queryParams["success"] = success is List ? success.join(',') : success; + if("null" != message) + queryParams["message"] = message is List ? message.join(',') : message; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20019); + } + else { + return null; + } + }); + } + + /// Store Update + /// + /// Store Update + Future updatesPost(Update body) { + Object postBody = body; + + + // create path and map variables + String path = "/updates".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20020); + } + else { + return null; + } + }); + } + + /// Get Update + /// + /// Get Update + Future updatesIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/updates/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20020); + } + else { + return null; + } + }); + } + + /// Update Update + /// + /// Update Update + Future updatesIdPut(int id, Update body) { + Object postBody = body; + + + // create path and map variables + String path = "/updates/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Update + /// + /// Delete Update + Future updatesIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/updates/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/user_variable_api.dart b/lib/api/user_variable_api.dart new file mode 100644 index 0000000..d7bd9a1 --- /dev/null +++ b/lib/api/user_variable_api.dart @@ -0,0 +1,353 @@ +part of api; + + +class UserVariableApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + UserVariableApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all UserVariables + /// + /// Get all UserVariables + Future userVariablesGet(String clientId, int variableId, int defaultUnitId, Number minimumAllowedValue, Number maximumAllowedValue, Number fillingValue, int joinWith, int onsetDelay, int durationOfAction, int variableCategoryId, int updated, int public, bool causeOnly, String fillingType, int numberOfMeasurements, int numberOfProcessedMeasurements, int measurementsAtLastAnalysis, int lastUnitId, int lastOriginalUnitId, int lastOriginalValue, Number lastValue, int lastSourceId, int numberOfCorrelations, String status, String errorMessage, String lastSuccessfulUpdateTime, Number standardDeviation, Number variance, Number minimumRecordedDailyValue, Number maximumRecordedDailyValue, Number mean, Number median, int mostCommonUnitId, Number mostCommonValue, Number numberOfUniqueDailyValues, int numberOfChanges, Number skewness, Number kurtosis, Number latitude, Number longitude, String location, String createdAt, String updatedAt, bool outcome, String sources, int earliestSourceTime, int latestSourceTime, int earliestMeasurementTime, int latestMeasurementTime, int earliestFillingTime, int latestFillingTime, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/userVariables".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != clientId) + queryParams["client_id"] = clientId is List ? clientId.join(',') : clientId; + if("null" != variableId) + queryParams["variable_id"] = variableId is List ? variableId.join(',') : variableId; + if("null" != defaultUnitId) + queryParams["default_unit_id"] = defaultUnitId is List ? defaultUnitId.join(',') : defaultUnitId; + if("null" != minimumAllowedValue) + queryParams["minimum_allowed_value"] = minimumAllowedValue is List ? minimumAllowedValue.join(',') : minimumAllowedValue; + if("null" != maximumAllowedValue) + queryParams["maximum_allowed_value"] = maximumAllowedValue is List ? maximumAllowedValue.join(',') : maximumAllowedValue; + if("null" != fillingValue) + queryParams["filling_value"] = fillingValue is List ? fillingValue.join(',') : fillingValue; + if("null" != joinWith) + queryParams["join_with"] = joinWith is List ? joinWith.join(',') : joinWith; + if("null" != onsetDelay) + queryParams["onset_delay"] = onsetDelay is List ? onsetDelay.join(',') : onsetDelay; + if("null" != durationOfAction) + queryParams["duration_of_action"] = durationOfAction is List ? durationOfAction.join(',') : durationOfAction; + if("null" != variableCategoryId) + queryParams["variable_category_id"] = variableCategoryId is List ? variableCategoryId.join(',') : variableCategoryId; + if("null" != updated) + queryParams["updated"] = updated is List ? updated.join(',') : updated; + if("null" != public) + queryParams["public"] = public is List ? public.join(',') : public; + if("null" != causeOnly) + queryParams["cause_only"] = causeOnly is List ? causeOnly.join(',') : causeOnly; + if("null" != fillingType) + queryParams["filling_type"] = fillingType is List ? fillingType.join(',') : fillingType; + if("null" != numberOfMeasurements) + queryParams["number_of_measurements"] = numberOfMeasurements is List ? numberOfMeasurements.join(',') : numberOfMeasurements; + if("null" != numberOfProcessedMeasurements) + queryParams["number_of_processed_measurements"] = numberOfProcessedMeasurements is List ? numberOfProcessedMeasurements.join(',') : numberOfProcessedMeasurements; + if("null" != measurementsAtLastAnalysis) + queryParams["measurements_at_last_analysis"] = measurementsAtLastAnalysis is List ? measurementsAtLastAnalysis.join(',') : measurementsAtLastAnalysis; + if("null" != lastUnitId) + queryParams["last_unit_id"] = lastUnitId is List ? lastUnitId.join(',') : lastUnitId; + if("null" != lastOriginalUnitId) + queryParams["last_original_unit_id"] = lastOriginalUnitId is List ? lastOriginalUnitId.join(',') : lastOriginalUnitId; + if("null" != lastOriginalValue) + queryParams["last_original_value"] = lastOriginalValue is List ? lastOriginalValue.join(',') : lastOriginalValue; + if("null" != lastValue) + queryParams["last_value"] = lastValue is List ? lastValue.join(',') : lastValue; + if("null" != lastSourceId) + queryParams["last_source_id"] = lastSourceId is List ? lastSourceId.join(',') : lastSourceId; + if("null" != numberOfCorrelations) + queryParams["number_of_correlations"] = numberOfCorrelations is List ? numberOfCorrelations.join(',') : numberOfCorrelations; + if("null" != status) + queryParams["status"] = status is List ? status.join(',') : status; + if("null" != errorMessage) + queryParams["error_message"] = errorMessage is List ? errorMessage.join(',') : errorMessage; + if("null" != lastSuccessfulUpdateTime) + queryParams["last_successful_update_time"] = lastSuccessfulUpdateTime is List ? lastSuccessfulUpdateTime.join(',') : lastSuccessfulUpdateTime; + if("null" != standardDeviation) + queryParams["standard_deviation"] = standardDeviation is List ? standardDeviation.join(',') : standardDeviation; + if("null" != variance) + queryParams["variance"] = variance is List ? variance.join(',') : variance; + if("null" != minimumRecordedDailyValue) + queryParams["minimum_recorded_daily_value"] = minimumRecordedDailyValue is List ? minimumRecordedDailyValue.join(',') : minimumRecordedDailyValue; + if("null" != maximumRecordedDailyValue) + queryParams["maximum_recorded_daily_value"] = maximumRecordedDailyValue is List ? maximumRecordedDailyValue.join(',') : maximumRecordedDailyValue; + if("null" != mean) + queryParams["mean"] = mean is List ? mean.join(',') : mean; + if("null" != median) + queryParams["median"] = median is List ? median.join(',') : median; + if("null" != mostCommonUnitId) + queryParams["most_common_unit_id"] = mostCommonUnitId is List ? mostCommonUnitId.join(',') : mostCommonUnitId; + if("null" != mostCommonValue) + queryParams["most_common_value"] = mostCommonValue is List ? mostCommonValue.join(',') : mostCommonValue; + if("null" != numberOfUniqueDailyValues) + queryParams["number_of_unique_daily_values"] = numberOfUniqueDailyValues is List ? numberOfUniqueDailyValues.join(',') : numberOfUniqueDailyValues; + if("null" != numberOfChanges) + queryParams["number_of_changes"] = numberOfChanges is List ? numberOfChanges.join(',') : numberOfChanges; + if("null" != skewness) + queryParams["skewness"] = skewness is List ? skewness.join(',') : skewness; + if("null" != kurtosis) + queryParams["kurtosis"] = kurtosis is List ? kurtosis.join(',') : kurtosis; + if("null" != latitude) + queryParams["latitude"] = latitude is List ? latitude.join(',') : latitude; + if("null" != longitude) + queryParams["longitude"] = longitude is List ? longitude.join(',') : longitude; + if("null" != location) + queryParams["location"] = location is List ? location.join(',') : location; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != outcome) + queryParams["outcome"] = outcome is List ? outcome.join(',') : outcome; + if("null" != sources) + queryParams["sources"] = sources is List ? sources.join(',') : sources; + if("null" != earliestSourceTime) + queryParams["earliest_source_time"] = earliestSourceTime is List ? earliestSourceTime.join(',') : earliestSourceTime; + if("null" != latestSourceTime) + queryParams["latest_source_time"] = latestSourceTime is List ? latestSourceTime.join(',') : latestSourceTime; + if("null" != earliestMeasurementTime) + queryParams["earliest_measurement_time"] = earliestMeasurementTime is List ? earliestMeasurementTime.join(',') : earliestMeasurementTime; + if("null" != latestMeasurementTime) + queryParams["latest_measurement_time"] = latestMeasurementTime is List ? latestMeasurementTime.join(',') : latestMeasurementTime; + if("null" != earliestFillingTime) + queryParams["earliest_filling_time"] = earliestFillingTime is List ? earliestFillingTime.join(',') : earliestFillingTime; + if("null" != latestFillingTime) + queryParams["latest_filling_time"] = latestFillingTime is List ? latestFillingTime.join(',') : latestFillingTime; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20021); + } + else { + return null; + } + }); + } + + /// Store UserVariable + /// + /// Store UserVariable + Future userVariablesPost(UserVariable body) { + Object postBody = body; + + + // create path and map variables + String path = "/userVariables".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20022); + } + else { + return null; + } + }); + } + + /// Get UserVariable + /// + /// Get UserVariable + Future userVariablesIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/userVariables/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20022); + } + else { + return null; + } + }); + } + + /// Update UserVariable + /// + /// Update UserVariable + Future userVariablesIdPut(int id, UserVariable body) { + Object postBody = body; + + + // create path and map variables + String path = "/userVariables/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete UserVariable + /// + /// Delete UserVariable + Future userVariablesIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/userVariables/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/variable_api.dart b/lib/api/variable_api.dart new file mode 100644 index 0000000..5a13bb5 --- /dev/null +++ b/lib/api/variable_api.dart @@ -0,0 +1,329 @@ +part of api; + + +class VariableApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + VariableApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Variables + /// + /// Get all Variables + Future variablesGet(int id, String clientId, int parentId, String name, int variableCategoryId, int defaultUnitId, String combinationOperation, Number fillingValue, Number maximumAllowedValue, Number minimumAllowedValue, int onsetDelay, int durationOfAction, int public, bool causeOnly, Number mostCommonValue, int mostCommonUnitId, Number standardDeviation, Number variance, Number mean, Number median, Number numberOfMeasurements, Number numberOfUniqueValues, Number skewness, Number kurtosis, Number latitude, Number longitude, String location, String status, String errorMessage, String lastSuccessfulUpdateTime, String createdAt, String updatedAt, String productUrl, String imageUrl, Number price, int numberOfUserVariables, bool outcome, Number minimumRecordedValue, Number maximumRecordedValue, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/variables".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != id) + queryParams["id"] = id is List ? id.join(',') : id; + if("null" != clientId) + queryParams["client_id"] = clientId is List ? clientId.join(',') : clientId; + if("null" != parentId) + queryParams["parent_id"] = parentId is List ? parentId.join(',') : parentId; + if("null" != name) + queryParams["name"] = name is List ? name.join(',') : name; + if("null" != variableCategoryId) + queryParams["variable_category_id"] = variableCategoryId is List ? variableCategoryId.join(',') : variableCategoryId; + if("null" != defaultUnitId) + queryParams["default_unit_id"] = defaultUnitId is List ? defaultUnitId.join(',') : defaultUnitId; + if("null" != combinationOperation) + queryParams["combination_operation"] = combinationOperation is List ? combinationOperation.join(',') : combinationOperation; + if("null" != fillingValue) + queryParams["filling_value"] = fillingValue is List ? fillingValue.join(',') : fillingValue; + if("null" != maximumAllowedValue) + queryParams["maximum_allowed_value"] = maximumAllowedValue is List ? maximumAllowedValue.join(',') : maximumAllowedValue; + if("null" != minimumAllowedValue) + queryParams["minimum_allowed_value"] = minimumAllowedValue is List ? minimumAllowedValue.join(',') : minimumAllowedValue; + if("null" != onsetDelay) + queryParams["onset_delay"] = onsetDelay is List ? onsetDelay.join(',') : onsetDelay; + if("null" != durationOfAction) + queryParams["duration_of_action"] = durationOfAction is List ? durationOfAction.join(',') : durationOfAction; + if("null" != public) + queryParams["public"] = public is List ? public.join(',') : public; + if("null" != causeOnly) + queryParams["cause_only"] = causeOnly is List ? causeOnly.join(',') : causeOnly; + if("null" != mostCommonValue) + queryParams["most_common_value"] = mostCommonValue is List ? mostCommonValue.join(',') : mostCommonValue; + if("null" != mostCommonUnitId) + queryParams["most_common_unit_id"] = mostCommonUnitId is List ? mostCommonUnitId.join(',') : mostCommonUnitId; + if("null" != standardDeviation) + queryParams["standard_deviation"] = standardDeviation is List ? standardDeviation.join(',') : standardDeviation; + if("null" != variance) + queryParams["variance"] = variance is List ? variance.join(',') : variance; + if("null" != mean) + queryParams["mean"] = mean is List ? mean.join(',') : mean; + if("null" != median) + queryParams["median"] = median is List ? median.join(',') : median; + if("null" != numberOfMeasurements) + queryParams["number_of_measurements"] = numberOfMeasurements is List ? numberOfMeasurements.join(',') : numberOfMeasurements; + if("null" != numberOfUniqueValues) + queryParams["number_of_unique_values"] = numberOfUniqueValues is List ? numberOfUniqueValues.join(',') : numberOfUniqueValues; + if("null" != skewness) + queryParams["skewness"] = skewness is List ? skewness.join(',') : skewness; + if("null" != kurtosis) + queryParams["kurtosis"] = kurtosis is List ? kurtosis.join(',') : kurtosis; + if("null" != latitude) + queryParams["latitude"] = latitude is List ? latitude.join(',') : latitude; + if("null" != longitude) + queryParams["longitude"] = longitude is List ? longitude.join(',') : longitude; + if("null" != location) + queryParams["location"] = location is List ? location.join(',') : location; + if("null" != status) + queryParams["status"] = status is List ? status.join(',') : status; + if("null" != errorMessage) + queryParams["error_message"] = errorMessage is List ? errorMessage.join(',') : errorMessage; + if("null" != lastSuccessfulUpdateTime) + queryParams["last_successful_update_time"] = lastSuccessfulUpdateTime is List ? lastSuccessfulUpdateTime.join(',') : lastSuccessfulUpdateTime; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != productUrl) + queryParams["product_url"] = productUrl is List ? productUrl.join(',') : productUrl; + if("null" != imageUrl) + queryParams["image_url"] = imageUrl is List ? imageUrl.join(',') : imageUrl; + if("null" != price) + queryParams["price"] = price is List ? price.join(',') : price; + if("null" != numberOfUserVariables) + queryParams["number_of_user_variables"] = numberOfUserVariables is List ? numberOfUserVariables.join(',') : numberOfUserVariables; + if("null" != outcome) + queryParams["outcome"] = outcome is List ? outcome.join(',') : outcome; + if("null" != minimumRecordedValue) + queryParams["minimum_recorded_value"] = minimumRecordedValue is List ? minimumRecordedValue.join(',') : minimumRecordedValue; + if("null" != maximumRecordedValue) + queryParams["maximum_recorded_value"] = maximumRecordedValue is List ? maximumRecordedValue.join(',') : maximumRecordedValue; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20027); + } + else { + return null; + } + }); + } + + /// Store Variable + /// + /// Store Variable + Future variablesPost(Variable body) { + Object postBody = body; + + + // create path and map variables + String path = "/variables".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20028); + } + else { + return null; + } + }); + } + + /// Get Variable + /// + /// Get Variable + Future variablesIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/variables/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20028); + } + else { + return null; + } + }); + } + + /// Update Variable + /// + /// Update Variable + Future variablesIdPut(int id, Variable body) { + Object postBody = body; + + + // create path and map variables + String path = "/variables/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Variable + /// + /// Delete Variable + Future variablesIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/variables/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/variable_category_api.dart b/lib/api/variable_category_api.dart new file mode 100644 index 0000000..e4bef63 --- /dev/null +++ b/lib/api/variable_category_api.dart @@ -0,0 +1,281 @@ +part of api; + + +class VariableCategoryApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + VariableCategoryApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all VariableCategories + /// + /// Get all VariableCategories + Future variableCategoriesGet(String name, Number fillingValue, Number maximumAllowedValue, Number minimumAllowedValue, int durationOfAction, int onsetDelay, String combinationOperation, int updated, bool causeOnly, int public, bool outcome, String createdAt, String updatedAt, String imageUrl, int defaultUnitId, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/variableCategories".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != name) + queryParams["name"] = name is List ? name.join(',') : name; + if("null" != fillingValue) + queryParams["filling_value"] = fillingValue is List ? fillingValue.join(',') : fillingValue; + if("null" != maximumAllowedValue) + queryParams["maximum_allowed_value"] = maximumAllowedValue is List ? maximumAllowedValue.join(',') : maximumAllowedValue; + if("null" != minimumAllowedValue) + queryParams["minimum_allowed_value"] = minimumAllowedValue is List ? minimumAllowedValue.join(',') : minimumAllowedValue; + if("null" != durationOfAction) + queryParams["duration_of_action"] = durationOfAction is List ? durationOfAction.join(',') : durationOfAction; + if("null" != onsetDelay) + queryParams["onset_delay"] = onsetDelay is List ? onsetDelay.join(',') : onsetDelay; + if("null" != combinationOperation) + queryParams["combination_operation"] = combinationOperation is List ? combinationOperation.join(',') : combinationOperation; + if("null" != updated) + queryParams["updated"] = updated is List ? updated.join(',') : updated; + if("null" != causeOnly) + queryParams["cause_only"] = causeOnly is List ? causeOnly.join(',') : causeOnly; + if("null" != public) + queryParams["public"] = public is List ? public.join(',') : public; + if("null" != outcome) + queryParams["outcome"] = outcome is List ? outcome.join(',') : outcome; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != imageUrl) + queryParams["image_url"] = imageUrl is List ? imageUrl.join(',') : imageUrl; + if("null" != defaultUnitId) + queryParams["default_unit_id"] = defaultUnitId is List ? defaultUnitId.join(',') : defaultUnitId; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20023); + } + else { + return null; + } + }); + } + + /// Store VariableCategory + /// + /// Store VariableCategory + Future variableCategoriesPost(VariableCategory body) { + Object postBody = body; + + + // create path and map variables + String path = "/variableCategories".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20024); + } + else { + return null; + } + }); + } + + /// Get VariableCategory + /// + /// Get VariableCategory + Future variableCategoriesIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/variableCategories/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20024); + } + else { + return null; + } + }); + } + + /// Update VariableCategory + /// + /// Update VariableCategory + Future variableCategoriesIdPut(int id, VariableCategory body) { + Object postBody = body; + + + // create path and map variables + String path = "/variableCategories/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete VariableCategory + /// + /// Delete VariableCategory + Future variableCategoriesIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/variableCategories/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/variable_user_source_api.dart b/lib/api/variable_user_source_api.dart new file mode 100644 index 0000000..aeffd13 --- /dev/null +++ b/lib/api/variable_user_source_api.dart @@ -0,0 +1,267 @@ +part of api; + + +class VariableUserSourceApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + VariableUserSourceApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all VariableUserSources + /// + /// Get all VariableUserSources + Future variableUserSourcesGet(int variableId, int userId, int timestamp, String createdAt, String updatedAt, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/variableUserSources".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != variableId) + queryParams["variable_id"] = variableId is List ? variableId.join(',') : variableId; + if("null" != userId) + queryParams["user_id"] = userId is List ? userId.join(',') : userId; + if("null" != timestamp) + queryParams["timestamp"] = timestamp is List ? timestamp.join(',') : timestamp; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20025); + } + else { + return null; + } + }); + } + + /// Store VariableUserSource + /// + /// Store VariableUserSource + Future variableUserSourcesPost(VariableUserSource body) { + Object postBody = body; + + + // create path and map variables + String path = "/variableUserSources".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20026); + } + else { + return null; + } + }); + } + + /// Get VariableUserSource + /// + /// Get VariableUserSource + Future variableUserSourcesIdGet(int id, int sourceId) { + Object postBody = null; + + + // create path and map variables + String path = "/variableUserSources/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != sourceId) + queryParams["source_id"] = sourceId is List ? sourceId.join(',') : sourceId; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20026); + } + else { + return null; + } + }); + } + + /// Update VariableUserSource + /// + /// Update VariableUserSource + Future variableUserSourcesIdPut(int id, int sourceId, VariableUserSource body) { + Object postBody = body; + + + // create path and map variables + String path = "/variableUserSources/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != sourceId) + queryParams["source_id"] = sourceId is List ? sourceId.join(',') : sourceId; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete VariableUserSource + /// + /// Delete VariableUserSource + Future variableUserSourcesIdDelete(int id, int sourceId) { + Object postBody = null; + + + // create path and map variables + String path = "/variableUserSources/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != sourceId) + queryParams["source_id"] = sourceId is List ? sourceId.join(',') : sourceId; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api/vote_api.dart b/lib/api/vote_api.dart new file mode 100644 index 0000000..fd3d74e --- /dev/null +++ b/lib/api/vote_api.dart @@ -0,0 +1,265 @@ +part of api; + + +class VoteApi { + String basePath = "https://app.quantimo.do/api/v2"; + ApiClient apiClient = ApiClient.defaultApiClient; + + VoteApi([ApiClient apiClient]) { + if (apiClient != null) { + this.apiClient = apiClient; + } + } + + + /// Get all Votes + /// + /// Get all Votes + Future votesGet(String clientId, int userId, int causeId, int effectId, int value, String createdAt, String updatedAt, int limit, int offset, String sort) { + Object postBody = null; + + + // create path and map variables + String path = "/votes".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + if("null" != clientId) + queryParams["client_id"] = clientId is List ? clientId.join(',') : clientId; + if("null" != userId) + queryParams["user_id"] = userId is List ? userId.join(',') : userId; + if("null" != causeId) + queryParams["cause_id"] = causeId is List ? causeId.join(',') : causeId; + if("null" != effectId) + queryParams["effect_id"] = effectId is List ? effectId.join(',') : effectId; + if("null" != value) + queryParams["value"] = value is List ? value.join(',') : value; + if("null" != createdAt) + queryParams["created_at"] = createdAt is List ? createdAt.join(',') : createdAt; + if("null" != updatedAt) + queryParams["updated_at"] = updatedAt is List ? updatedAt.join(',') : updatedAt; + if("null" != limit) + queryParams["limit"] = limit is List ? limit.join(',') : limit; + if("null" != offset) + queryParams["offset"] = offset is List ? offset.join(',') : offset; + if("null" != sort) + queryParams["sort"] = sort is List ? sort.join(',') : sort; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20029); + } + else { + return null; + } + }); + } + + /// Store Vote + /// + /// Store Vote + Future votesPost(Vote body) { + Object postBody = body; + + + // create path and map variables + String path = "/votes".replaceAll("{format}","json"); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'POST', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20030); + } + else { + return null; + } + }); + } + + /// Get Vote + /// + /// Get Vote + Future votesIdGet(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/votes/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'GET', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse20030); + } + else { + return null; + } + }); + } + + /// Update Vote + /// + /// Update Vote + Future votesIdPut(int id, Vote body) { + Object postBody = body; + + + // create path and map variables + String path = "/votes/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'PUT', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + + /// Delete Vote + /// + /// Delete Vote + Future votesIdDelete(int id) { + Object postBody = null; + + + // create path and map variables + String path = "/votes/{id}".replaceAll("{format}","json").replaceAll("{" + "id" + "}", id.toString()); + + // query params + Map queryParams = {}; + Map headerParams = {}; + Map formParams = {}; + + + + List contentTypes = ["application/json"]; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; + + if(contentType.startsWith("multipart/form-data")) { + bool hasFields = false; + MultipartRequest mp = new MultipartRequest(null, null); + + if(hasFields) + postBody = mp; + } + else { + + } + + return apiClient.invokeAPI(basePath, path, 'DELETE', queryParams, postBody, headerParams, formParams, contentType, authNames).then((response) { + if(response.statusCode >= 400) { + throw new ApiException(response.statusCode, response.body); + } + else if(response.body != null){ + return ApiClient.deserialize(response.body, InlineResponse2002); + } + else { + return null; + } + }); + } + +} diff --git a/lib/api_client.dart b/lib/api_client.dart new file mode 100644 index 0000000..a189fbd --- /dev/null +++ b/lib/api_client.dart @@ -0,0 +1,403 @@ +part of api; + +class ApiClient { + static ApiClient defaultApiClient = new ApiClient(); + + Map _defaultHeaderMap = {}; + Map _authentications = {}; + static final dson = new Dartson.JSON(); + final DateFormat _dateFormatter = new DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + + ApiClient() { + // Setup authentications (key: authentication name, value: authentication). + _authentications['quantimodo_oauth2'] = new OAuth(); + } + + void addDefaultHeader(String key, String value) { + _defaultHeaderMap[key] = value; + } + + /// Format the given Date object into string. + String formatDate(DateTime date) { + return _dateFormatter.format(date); + } + + /// Format the given parameter object into string. + String parameterToString(Object param) { + if (param == null) { + return ''; + } else if (param is DateTime) { + return formatDate(param); + } else if (param is List) { + return (param).join(','); + } else { + return param.toString(); + } + } + + static dynamic deserialize(String json, dynamic clazz) { + var result = json; + + try { + var decodedJson = JSON.decode(json); + + if(decodedJson is List) { + result = []; + for(var obj in decodedJson) { + result.add(_createEntity(obj, clazz)); + } + } else { + result = _createEntity(json, clazz); + } + } on FormatException { + // Just return the passed in value + } + + return result; + } + + static dynamic _createEntity(dynamic json, dynamic clazz) { + bool isMap = json is Map; + + switch(clazz) { + + + case MeasurementValue: + return isMap ? dson.map(json, new MeasurementValue()) : dson.decode(json, new MeasurementValue()); + + + + case MeasurementPost: + return isMap ? dson.map(json, new MeasurementPost()) : dson.decode(json, new MeasurementPost()); + + + + case AggregatedCorrelation: + return isMap ? dson.map(json, new AggregatedCorrelation()) : dson.decode(json, new AggregatedCorrelation()); + + + + case Connection: + return isMap ? dson.map(json, new Connection()) : dson.decode(json, new Connection()); + + + + case Connector: + return isMap ? dson.map(json, new Connector()) : dson.decode(json, new Connector()); + + + + case Correlation: + return isMap ? dson.map(json, new Correlation()) : dson.decode(json, new Correlation()); + + + + case Credential: + return isMap ? dson.map(json, new Credential()) : dson.decode(json, new Credential()); + + + + case Measurement: + return isMap ? dson.map(json, new Measurement()) : dson.decode(json, new Measurement()); + + + + case MeasurementExport: + return isMap ? dson.map(json, new MeasurementExport()) : dson.decode(json, new MeasurementExport()); + + + + case Source: + return isMap ? dson.map(json, new Source()) : dson.decode(json, new Source()); + + + + case Unit: + return isMap ? dson.map(json, new Unit()) : dson.decode(json, new Unit()); + + + + case UnitCategory: + return isMap ? dson.map(json, new UnitCategory()) : dson.decode(json, new UnitCategory()); + + + + case UnitConversion: + return isMap ? dson.map(json, new UnitConversion()) : dson.decode(json, new UnitConversion()); + + + + case Update: + return isMap ? dson.map(json, new Update()) : dson.decode(json, new Update()); + + + + case UserVariable: + return isMap ? dson.map(json, new UserVariable()) : dson.decode(json, new UserVariable()); + + + + case Variable: + return isMap ? dson.map(json, new Variable()) : dson.decode(json, new Variable()); + + + + case VariableCategory: + return isMap ? dson.map(json, new VariableCategory()) : dson.decode(json, new VariableCategory()); + + + + case VariableUserSource: + return isMap ? dson.map(json, new VariableUserSource()) : dson.decode(json, new VariableUserSource()); + + + + case Vote: + return isMap ? dson.map(json, new Vote()) : dson.decode(json, new Vote()); + + + + case InlineResponse200: + return isMap ? dson.map(json, new InlineResponse200()) : dson.decode(json, new InlineResponse200()); + + + + case InlineResponse2001: + return isMap ? dson.map(json, new InlineResponse2001()) : dson.decode(json, new InlineResponse2001()); + + + + case InlineResponse2002: + return isMap ? dson.map(json, new InlineResponse2002()) : dson.decode(json, new InlineResponse2002()); + + + + case InlineResponse2003: + return isMap ? dson.map(json, new InlineResponse2003()) : dson.decode(json, new InlineResponse2003()); + + + + case InlineResponse2004: + return isMap ? dson.map(json, new InlineResponse2004()) : dson.decode(json, new InlineResponse2004()); + + + + case InlineResponse2005: + return isMap ? dson.map(json, new InlineResponse2005()) : dson.decode(json, new InlineResponse2005()); + + + + case InlineResponse2006: + return isMap ? dson.map(json, new InlineResponse2006()) : dson.decode(json, new InlineResponse2006()); + + + + case InlineResponse2007: + return isMap ? dson.map(json, new InlineResponse2007()) : dson.decode(json, new InlineResponse2007()); + + + + case InlineResponse2008: + return isMap ? dson.map(json, new InlineResponse2008()) : dson.decode(json, new InlineResponse2008()); + + + + case InlineResponse2009: + return isMap ? dson.map(json, new InlineResponse2009()) : dson.decode(json, new InlineResponse2009()); + + + + case InlineResponse20010: + return isMap ? dson.map(json, new InlineResponse20010()) : dson.decode(json, new InlineResponse20010()); + + + + case InlineResponse20011: + return isMap ? dson.map(json, new InlineResponse20011()) : dson.decode(json, new InlineResponse20011()); + + + + case InlineResponse20012: + return isMap ? dson.map(json, new InlineResponse20012()) : dson.decode(json, new InlineResponse20012()); + + + + case InlineResponse20013: + return isMap ? dson.map(json, new InlineResponse20013()) : dson.decode(json, new InlineResponse20013()); + + + + case InlineResponse20014: + return isMap ? dson.map(json, new InlineResponse20014()) : dson.decode(json, new InlineResponse20014()); + + + + case InlineResponse20015: + return isMap ? dson.map(json, new InlineResponse20015()) : dson.decode(json, new InlineResponse20015()); + + + + case InlineResponse20016: + return isMap ? dson.map(json, new InlineResponse20016()) : dson.decode(json, new InlineResponse20016()); + + + + case InlineResponse20017: + return isMap ? dson.map(json, new InlineResponse20017()) : dson.decode(json, new InlineResponse20017()); + + + + case InlineResponse20018: + return isMap ? dson.map(json, new InlineResponse20018()) : dson.decode(json, new InlineResponse20018()); + + + + case InlineResponse20019: + return isMap ? dson.map(json, new InlineResponse20019()) : dson.decode(json, new InlineResponse20019()); + + + + case InlineResponse20020: + return isMap ? dson.map(json, new InlineResponse20020()) : dson.decode(json, new InlineResponse20020()); + + + + case InlineResponse20021: + return isMap ? dson.map(json, new InlineResponse20021()) : dson.decode(json, new InlineResponse20021()); + + + + case InlineResponse20022: + return isMap ? dson.map(json, new InlineResponse20022()) : dson.decode(json, new InlineResponse20022()); + + + + case InlineResponse20023: + return isMap ? dson.map(json, new InlineResponse20023()) : dson.decode(json, new InlineResponse20023()); + + + + case InlineResponse20024: + return isMap ? dson.map(json, new InlineResponse20024()) : dson.decode(json, new InlineResponse20024()); + + + + case InlineResponse20025: + return isMap ? dson.map(json, new InlineResponse20025()) : dson.decode(json, new InlineResponse20025()); + + + + case InlineResponse20026: + return isMap ? dson.map(json, new InlineResponse20026()) : dson.decode(json, new InlineResponse20026()); + + + + case InlineResponse20027: + return isMap ? dson.map(json, new InlineResponse20027()) : dson.decode(json, new InlineResponse20027()); + + + + case InlineResponse20028: + return isMap ? dson.map(json, new InlineResponse20028()) : dson.decode(json, new InlineResponse20028()); + + + + case InlineResponse20029: + return isMap ? dson.map(json, new InlineResponse20029()) : dson.decode(json, new InlineResponse20029()); + + + + case InlineResponse20030: + return isMap ? dson.map(json, new InlineResponse20030()) : dson.decode(json, new InlineResponse20030()); + + + default: + throw new ApiException(500, 'Could not find a suitable class for deserialization'); + } + } + + static String serialize(Object obj) { + String serialized = ''; + if (obj == null) { + serialized = ''; + } else if (obj is String) { + serialized = obj; + } else { + serialized = dson.encode(obj); + } + return serialized; + } + + Future invokeAPI( String host, + String path, + String method, + Map queryParams, + Object body, + Map headerParams, + Map formParams, + String contentType, + List authNames) { + + updateParamsForAuth(authNames, queryParams, headerParams); + + var client = new BrowserClient(); + + StringBuffer sb = new StringBuffer(); + + for(String key in queryParams.keys) { + String value = queryParams[key]; + if (value != null){ + if(sb.toString().length == 0) { + sb.write("?"); + } else { + sb.write("&"); + } + sb.write(key); + sb.write("="); + sb.write(value); + } + } + String querystring = sb.toString(); + + String url = host + path + querystring; + + headerParams.addAll(_defaultHeaderMap); + headerParams['Content-Type'] = contentType; + + var completer = new Completer(); + + if(body is MultipartRequest) { + var request = new MultipartRequest(method, Uri.parse(url)); + request.fields.addAll(body.fields); + request.files.addAll(body.files); + request.headers.addAll(body.headers); + request.headers.addAll(headerParams); + client.send(request).then((response) => completer.complete(Response.fromStream(response))); + } else { + var msgBody = contentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); + switch(method) { + case "GET": + return client.get(url, headers: headerParams); + case "POST": + return client.post(url, headers: headerParams, body: msgBody); + case "PUT": + return client.put(url, headers: headerParams, body: msgBody); + case "DELETE": + return client.delete(url, headers: headerParams); + } + } + + return completer.future; + } + + /// Update query and header parameters based on authentication settings. + /// @param authNames The authentications to apply + void updateParamsForAuth(List authNames, Map queryParams, Map headerParams) { + authNames.forEach((authName) { + Authentication auth = _authentications[authName]; + if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams); + }); + } + +} diff --git a/lib/api_exception.dart b/lib/api_exception.dart new file mode 100644 index 0000000..c168fb5 --- /dev/null +++ b/lib/api_exception.dart @@ -0,0 +1,9 @@ +part of api; + +class ApiException implements Exception { + int code = 0; + String message = null; + + ApiException(this.code, this.message); + +} \ No newline at end of file diff --git a/lib/auth/api_key_auth.dart b/lib/auth/api_key_auth.dart new file mode 100644 index 0000000..6e728ae --- /dev/null +++ b/lib/auth/api_key_auth.dart @@ -0,0 +1,28 @@ +part of api; + +class ApiKeyAuth implements Authentication { + + final String location; + final String paramName; + String apiKey; + String apiKeyPrefix; + + ApiKeyAuth(this.location, this.paramName); + + @override + void applyToParams(Map queryParams, Map headerParams) { + String value; + if (apiKeyPrefix != null) { + value = '$apiKeyPrefix $apiKey'; + } else { + value = apiKey; + } + + if (location == 'query' && value != null) { + queryParams[paramName] = value; + } else if (location == 'header' && value != null) { + headerParams[paramName] = value; + } + } + +} \ No newline at end of file diff --git a/lib/auth/authentication.dart b/lib/auth/authentication.dart new file mode 100644 index 0000000..4833af9 --- /dev/null +++ b/lib/auth/authentication.dart @@ -0,0 +1,7 @@ +part of api; + +abstract class Authentication { + + /// Apply authentication settings to header and query params. + void applyToParams(Map queryParams, Map headerParams); +} \ No newline at end of file diff --git a/lib/auth/http_basic_auth.dart b/lib/auth/http_basic_auth.dart new file mode 100644 index 0000000..e681c25 --- /dev/null +++ b/lib/auth/http_basic_auth.dart @@ -0,0 +1,14 @@ +part of api; + +class HttpBasicAuth implements Authentication { + + String username; + String password; + + @override + void applyToParams(Map queryParams, Map headerParams) { + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams["Authorization"] = "Basic " + CryptoUtils.bytesToBase64(UTF8.encode(str)); + } + +} \ No newline at end of file diff --git a/lib/auth/oauth.dart b/lib/auth/oauth.dart new file mode 100644 index 0000000..5e3e2c8 --- /dev/null +++ b/lib/auth/oauth.dart @@ -0,0 +1,9 @@ +part of api; + +class OAuth implements Authentication { + + @override + void applyToParams(Map queryParams, Map headerParams) { + // TODO: support oauth + } +} \ No newline at end of file diff --git a/lib/model/aggregated_correlation.dart b/lib/model/aggregated_correlation.dart new file mode 100644 index 0000000..d780aea --- /dev/null +++ b/lib/model/aggregated_correlation.dart @@ -0,0 +1,93 @@ +part of api; + + +@Entity() +class AggregatedCorrelation { + /* id */ + int id = null; + + /* correlation */ + num correlation = null; + + /* cause_id */ + int causeId = null; + + /* effect_id */ + int effectId = null; + + /* onset_delay */ + int onsetDelay = null; + + /* duration_of_action */ + int durationOfAction = null; + + /* number_of_pairs */ + int numberOfPairs = null; + + /* value_predicting_high_outcome */ + num valuePredictingHighOutcome = null; + + /* value_predicting_low_outcome */ + num valuePredictingLowOutcome = null; + + /* optimal_pearson_product */ + num optimalPearsonProduct = null; + + /* vote */ + num vote = null; + + /* number_of_users */ + int numberOfUsers = null; + + /* number_of_correlations */ + int numberOfCorrelations = null; + + /* statistical_significance */ + num statisticalSignificance = null; + + /* cause_unit */ + String causeUnit = null; + + /* cause_unit_id */ + int causeUnitId = null; + + /* cause_changes */ + int causeChanges = null; + + /* effect_changes */ + int effectChanges = null; + + /* aggregate_qm_score */ + num aggregateQmScore = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + /* status */ + String status = null; + + /* error_message */ + String errorMessage = null; + + /* last_successful_update_time */ + DateTime lastSuccessfulUpdateTime = null; + + /* reverse_pearson_correlation_coefficient */ + num reversePearsonCorrelationCoefficient = null; + + /* predictive_pearson_correlation_coefficient */ + num predictivePearsonCorrelationCoefficient = null; + + + AggregatedCorrelation(); + + @override + String toString() { + return 'AggregatedCorrelation[id=$id, correlation=$correlation, causeId=$causeId, effectId=$effectId, onsetDelay=$onsetDelay, durationOfAction=$durationOfAction, numberOfPairs=$numberOfPairs, valuePredictingHighOutcome=$valuePredictingHighOutcome, valuePredictingLowOutcome=$valuePredictingLowOutcome, optimalPearsonProduct=$optimalPearsonProduct, vote=$vote, numberOfUsers=$numberOfUsers, numberOfCorrelations=$numberOfCorrelations, statisticalSignificance=$statisticalSignificance, causeUnit=$causeUnit, causeUnitId=$causeUnitId, causeChanges=$causeChanges, effectChanges=$effectChanges, aggregateQmScore=$aggregateQmScore, createdAt=$createdAt, updatedAt=$updatedAt, status=$status, errorMessage=$errorMessage, lastSuccessfulUpdateTime=$lastSuccessfulUpdateTime, reversePearsonCorrelationCoefficient=$reversePearsonCorrelationCoefficient, predictivePearsonCorrelationCoefficient=$predictivePearsonCorrelationCoefficient, ]'; + } + +} + diff --git a/lib/model/connection.dart b/lib/model/connection.dart new file mode 100644 index 0000000..64a2485 --- /dev/null +++ b/lib/model/connection.dart @@ -0,0 +1,48 @@ +part of api; + + +@Entity() +class Connection { + /* id */ + int id = null; + + /* user_id */ + int userId = null; + + /* connector_id */ + int connectorId = null; + + /* connect_status */ + String connectStatus = null; + + /* connect_error */ + String connectError = null; + + /* update_requested_at */ + DateTime updateRequestedAt = null; + + /* update_status */ + String updateStatus = null; + + /* update_error */ + String updateError = null; + + /* last_successful_updated_at */ + DateTime lastSuccessfulUpdatedAt = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + Connection(); + + @override + String toString() { + return 'Connection[id=$id, userId=$userId, connectorId=$connectorId, connectStatus=$connectStatus, connectError=$connectError, updateRequestedAt=$updateRequestedAt, updateStatus=$updateStatus, updateError=$updateError, lastSuccessfulUpdatedAt=$lastSuccessfulUpdatedAt, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/lib/model/connector.dart b/lib/model/connector.dart new file mode 100644 index 0000000..da01228 --- /dev/null +++ b/lib/model/connector.dart @@ -0,0 +1,42 @@ +part of api; + + +@Entity() +class Connector { + /* Connector ID number */ + int id = null; + + /* Connector lowercase system name */ + String name = null; + + /* Connector pretty display name */ + String displayName = null; + + /* URL to the image of the connector logo */ + String image = null; + + /* URL to a site where one can get this device or application */ + String getItUrl = null; + + /* Short description */ + String shortDescription = null; + + /* Long description */ + String longDescription = null; + + /* enabled */ + bool enabled = null; + + /* oauth */ + bool oauth = null; + + + Connector(); + + @override + String toString() { + return 'Connector[id=$id, name=$name, displayName=$displayName, image=$image, getItUrl=$getItUrl, shortDescription=$shortDescription, longDescription=$longDescription, enabled=$enabled, oauth=$oauth, ]'; + } + +} + diff --git a/lib/model/correlation.dart b/lib/model/correlation.dart new file mode 100644 index 0000000..72feaa5 --- /dev/null +++ b/lib/model/correlation.dart @@ -0,0 +1,87 @@ +part of api; + + +@Entity() +class Correlation { + /* id */ + int id = null; + + /* Time at which correlation was calculated */ + int timestamp = null; + + /* ID of user that owns this correlation */ + int userId = null; + + /* Pearson correlation coefficient between cause and effect measurements */ + num correlation = null; + + /* variable ID of the cause variable for which the user desires correlations */ + int causeId = null; + + /* variable ID of the effect variable for which the user desires correlations */ + int effectId = null; + + /* User estimated or default time after cause measurement before a perceivable effect is observed */ + int onsetDelay = null; + + /* Time over which the cause is expected to produce a perceivable effect following the onset delay */ + int durationOfAction = null; + + /* Number of points that went into the correlation calculation */ + int numberOfPairs = null; + + /* cause value that predicts an above average effect value (in default unit for cause variable) */ + num valuePredictingHighOutcome = null; + + /* cause value that predicts a below average effect value (in default unit for cause variable) */ + num valuePredictingLowOutcome = null; + + /* Optimal Pearson Product */ + num optimalPearsonProduct = null; + + /* Vote */ + num vote = null; + + /* A function of the effect size and sample size */ + num statisticalSignificance = null; + + /* Unit of Cause */ + String causeUnit = null; + + /* Unit ID of Cause */ + int causeUnitId = null; + + /* Cause changes */ + int causeChanges = null; + + /* Effect changes */ + int effectChanges = null; + + /* QM Score */ + num qmScore = null; + + /* error */ + String error = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + /* Correlation when cause and effect are reversed. For any causal relationship, the forward correlation should exceed the reverse correlation */ + num reversePearsonCorrelationCoefficient = null; + + /* Predictive Pearson Correlation Coefficient */ + num predictivePearsonCorrelationCoefficient = null; + + + Correlation(); + + @override + String toString() { + return 'Correlation[id=$id, timestamp=$timestamp, userId=$userId, correlation=$correlation, causeId=$causeId, effectId=$effectId, onsetDelay=$onsetDelay, durationOfAction=$durationOfAction, numberOfPairs=$numberOfPairs, valuePredictingHighOutcome=$valuePredictingHighOutcome, valuePredictingLowOutcome=$valuePredictingLowOutcome, optimalPearsonProduct=$optimalPearsonProduct, vote=$vote, statisticalSignificance=$statisticalSignificance, causeUnit=$causeUnit, causeUnitId=$causeUnitId, causeChanges=$causeChanges, effectChanges=$effectChanges, qmScore=$qmScore, error=$error, createdAt=$createdAt, updatedAt=$updatedAt, reversePearsonCorrelationCoefficient=$reversePearsonCorrelationCoefficient, predictivePearsonCorrelationCoefficient=$predictivePearsonCorrelationCoefficient, ]'; + } + +} + diff --git a/lib/model/credential.dart b/lib/model/credential.dart new file mode 100644 index 0000000..8456846 --- /dev/null +++ b/lib/model/credential.dart @@ -0,0 +1,30 @@ +part of api; + + +@Entity() +class Credential { + /* connector_id */ + int connectorId = null; + + /* attr_key */ + String attrKey = null; + + /* attr_value */ + String attrValue = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + Credential(); + + @override + String toString() { + return 'Credential[connectorId=$connectorId, attrKey=$attrKey, attrValue=$attrValue, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/lib/model/inline_response200.dart b/lib/model/inline_response200.dart new file mode 100644 index 0000000..d62c221 --- /dev/null +++ b/lib/model/inline_response200.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse200 { + + List data = []; + + + bool success = null; + + + InlineResponse200(); + + @override + String toString() { + return 'InlineResponse200[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response2001.dart b/lib/model/inline_response2001.dart new file mode 100644 index 0000000..9eb3b33 --- /dev/null +++ b/lib/model/inline_response2001.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse2001 { + + AggregatedCorrelation data = null; + + + bool success = null; + + + InlineResponse2001(); + + @override + String toString() { + return 'InlineResponse2001[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20010.dart b/lib/model/inline_response20010.dart new file mode 100644 index 0000000..b42cae5 --- /dev/null +++ b/lib/model/inline_response20010.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20010 { + + Credential data = null; + + + bool success = null; + + + InlineResponse20010(); + + @override + String toString() { + return 'InlineResponse20010[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20011.dart b/lib/model/inline_response20011.dart new file mode 100644 index 0000000..7c06393 --- /dev/null +++ b/lib/model/inline_response20011.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20011 { + + List data = []; + + + bool success = null; + + + InlineResponse20011(); + + @override + String toString() { + return 'InlineResponse20011[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20012.dart b/lib/model/inline_response20012.dart new file mode 100644 index 0000000..eb46fcb --- /dev/null +++ b/lib/model/inline_response20012.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20012 { + + Measurement data = null; + + + bool success = null; + + + InlineResponse20012(); + + @override + String toString() { + return 'InlineResponse20012[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20013.dart b/lib/model/inline_response20013.dart new file mode 100644 index 0000000..2eb218a --- /dev/null +++ b/lib/model/inline_response20013.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20013 { + + List data = []; + + + bool success = null; + + + InlineResponse20013(); + + @override + String toString() { + return 'InlineResponse20013[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20014.dart b/lib/model/inline_response20014.dart new file mode 100644 index 0000000..d77394c --- /dev/null +++ b/lib/model/inline_response20014.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20014 { + + Source data = null; + + + bool success = null; + + + InlineResponse20014(); + + @override + String toString() { + return 'InlineResponse20014[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20015.dart b/lib/model/inline_response20015.dart new file mode 100644 index 0000000..12cc9f9 --- /dev/null +++ b/lib/model/inline_response20015.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20015 { + + List data = []; + + + bool success = null; + + + InlineResponse20015(); + + @override + String toString() { + return 'InlineResponse20015[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20016.dart b/lib/model/inline_response20016.dart new file mode 100644 index 0000000..0ce1d44 --- /dev/null +++ b/lib/model/inline_response20016.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20016 { + + UnitCategory data = null; + + + bool success = null; + + + InlineResponse20016(); + + @override + String toString() { + return 'InlineResponse20016[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20017.dart b/lib/model/inline_response20017.dart new file mode 100644 index 0000000..1ddf05b --- /dev/null +++ b/lib/model/inline_response20017.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20017 { + + List data = []; + + + bool success = null; + + + InlineResponse20017(); + + @override + String toString() { + return 'InlineResponse20017[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20018.dart b/lib/model/inline_response20018.dart new file mode 100644 index 0000000..93a3919 --- /dev/null +++ b/lib/model/inline_response20018.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20018 { + + Unit data = null; + + + bool success = null; + + + InlineResponse20018(); + + @override + String toString() { + return 'InlineResponse20018[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20019.dart b/lib/model/inline_response20019.dart new file mode 100644 index 0000000..23622b3 --- /dev/null +++ b/lib/model/inline_response20019.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20019 { + + List data = []; + + + bool success = null; + + + InlineResponse20019(); + + @override + String toString() { + return 'InlineResponse20019[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response2002.dart b/lib/model/inline_response2002.dart new file mode 100644 index 0000000..5ee911f --- /dev/null +++ b/lib/model/inline_response2002.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse2002 { + + String data = null; + + + bool success = null; + + + InlineResponse2002(); + + @override + String toString() { + return 'InlineResponse2002[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20020.dart b/lib/model/inline_response20020.dart new file mode 100644 index 0000000..60771dc --- /dev/null +++ b/lib/model/inline_response20020.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20020 { + + Update data = null; + + + bool success = null; + + + InlineResponse20020(); + + @override + String toString() { + return 'InlineResponse20020[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20021.dart b/lib/model/inline_response20021.dart new file mode 100644 index 0000000..06eb040 --- /dev/null +++ b/lib/model/inline_response20021.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20021 { + + List data = []; + + + bool success = null; + + + InlineResponse20021(); + + @override + String toString() { + return 'InlineResponse20021[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20022.dart b/lib/model/inline_response20022.dart new file mode 100644 index 0000000..0fd24e9 --- /dev/null +++ b/lib/model/inline_response20022.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20022 { + + UserVariable data = null; + + + bool success = null; + + + InlineResponse20022(); + + @override + String toString() { + return 'InlineResponse20022[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20023.dart b/lib/model/inline_response20023.dart new file mode 100644 index 0000000..68971e3 --- /dev/null +++ b/lib/model/inline_response20023.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20023 { + + List data = []; + + + bool success = null; + + + InlineResponse20023(); + + @override + String toString() { + return 'InlineResponse20023[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20024.dart b/lib/model/inline_response20024.dart new file mode 100644 index 0000000..34fbf21 --- /dev/null +++ b/lib/model/inline_response20024.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20024 { + + VariableCategory data = null; + + + bool success = null; + + + InlineResponse20024(); + + @override + String toString() { + return 'InlineResponse20024[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20025.dart b/lib/model/inline_response20025.dart new file mode 100644 index 0000000..a890574 --- /dev/null +++ b/lib/model/inline_response20025.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20025 { + + List data = []; + + + bool success = null; + + + InlineResponse20025(); + + @override + String toString() { + return 'InlineResponse20025[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20026.dart b/lib/model/inline_response20026.dart new file mode 100644 index 0000000..5bc3ad5 --- /dev/null +++ b/lib/model/inline_response20026.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20026 { + + VariableUserSource data = null; + + + bool success = null; + + + InlineResponse20026(); + + @override + String toString() { + return 'InlineResponse20026[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20027.dart b/lib/model/inline_response20027.dart new file mode 100644 index 0000000..630075e --- /dev/null +++ b/lib/model/inline_response20027.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20027 { + + List data = []; + + + bool success = null; + + + InlineResponse20027(); + + @override + String toString() { + return 'InlineResponse20027[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20028.dart b/lib/model/inline_response20028.dart new file mode 100644 index 0000000..575554c --- /dev/null +++ b/lib/model/inline_response20028.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20028 { + + Variable data = null; + + + bool success = null; + + + InlineResponse20028(); + + @override + String toString() { + return 'InlineResponse20028[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20029.dart b/lib/model/inline_response20029.dart new file mode 100644 index 0000000..34a9e2e --- /dev/null +++ b/lib/model/inline_response20029.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20029 { + + List data = []; + + + bool success = null; + + + InlineResponse20029(); + + @override + String toString() { + return 'InlineResponse20029[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response2003.dart b/lib/model/inline_response2003.dart new file mode 100644 index 0000000..f29343c --- /dev/null +++ b/lib/model/inline_response2003.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse2003 { + + List data = []; + + + bool success = null; + + + InlineResponse2003(); + + @override + String toString() { + return 'InlineResponse2003[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response20030.dart b/lib/model/inline_response20030.dart new file mode 100644 index 0000000..2eacbc6 --- /dev/null +++ b/lib/model/inline_response20030.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse20030 { + + Vote data = null; + + + bool success = null; + + + InlineResponse20030(); + + @override + String toString() { + return 'InlineResponse20030[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response2004.dart b/lib/model/inline_response2004.dart new file mode 100644 index 0000000..dfdb74d --- /dev/null +++ b/lib/model/inline_response2004.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse2004 { + + Connection data = null; + + + bool success = null; + + + InlineResponse2004(); + + @override + String toString() { + return 'InlineResponse2004[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response2005.dart b/lib/model/inline_response2005.dart new file mode 100644 index 0000000..84cd417 --- /dev/null +++ b/lib/model/inline_response2005.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse2005 { + + List data = []; + + + bool success = null; + + + InlineResponse2005(); + + @override + String toString() { + return 'InlineResponse2005[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response2006.dart b/lib/model/inline_response2006.dart new file mode 100644 index 0000000..23b9fb0 --- /dev/null +++ b/lib/model/inline_response2006.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse2006 { + + Connector data = null; + + + bool success = null; + + + InlineResponse2006(); + + @override + String toString() { + return 'InlineResponse2006[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response2007.dart b/lib/model/inline_response2007.dart new file mode 100644 index 0000000..f67908c --- /dev/null +++ b/lib/model/inline_response2007.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse2007 { + + List data = []; + + + bool success = null; + + + InlineResponse2007(); + + @override + String toString() { + return 'InlineResponse2007[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response2008.dart b/lib/model/inline_response2008.dart new file mode 100644 index 0000000..6832bc0 --- /dev/null +++ b/lib/model/inline_response2008.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse2008 { + + Correlation data = null; + + + bool success = null; + + + InlineResponse2008(); + + @override + String toString() { + return 'InlineResponse2008[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/inline_response2009.dart b/lib/model/inline_response2009.dart new file mode 100644 index 0000000..b3a2dc1 --- /dev/null +++ b/lib/model/inline_response2009.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class InlineResponse2009 { + + List data = []; + + + bool success = null; + + + InlineResponse2009(); + + @override + String toString() { + return 'InlineResponse2009[data=$data, success=$success, ]'; + } + +} + diff --git a/lib/model/measurement.dart b/lib/model/measurement.dart new file mode 100644 index 0000000..cf2fca3 --- /dev/null +++ b/lib/model/measurement.dart @@ -0,0 +1,72 @@ +part of api; + + +@Entity() +class Measurement { + /* id */ + int id = null; + + /* ID of user that owns this measurement */ + int userId = null; + + /* client_id */ + String clientId = null; + + /* Connector ID */ + int connectorId = null; + + /* ID of the variable for which we are creating the measurement records */ + int variableId = null; + + /* Application or device used to record the measurement values */ + int sourceId = null; + + /* Start Time for the measurement event in ISO 8601 */ + int startTime = null; + + /* Converted measurement value in requested unit */ + num value = null; + + /* Unit ID of measurement as requested in GET request */ + int unitId = null; + + /* Original value */ + num originalValue = null; + + /* Unit ID of measurement as originally submitted */ + int originalUnitId = null; + + /* duration of measurement in seconds */ + int duration = null; + + /* Note of measurement */ + String note = null; + + /* latitude */ + num latitude = null; + + /* longitude */ + num longitude = null; + + /* location */ + String location = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + /* error */ + String error = null; + + + Measurement(); + + @override + String toString() { + return 'Measurement[id=$id, userId=$userId, clientId=$clientId, connectorId=$connectorId, variableId=$variableId, sourceId=$sourceId, startTime=$startTime, value=$value, unitId=$unitId, originalValue=$originalValue, originalUnitId=$originalUnitId, duration=$duration, note=$note, latitude=$latitude, longitude=$longitude, location=$location, createdAt=$createdAt, updatedAt=$updatedAt, error=$error, ]'; + } + +} + diff --git a/lib/model/measurement_export.dart b/lib/model/measurement_export.dart new file mode 100644 index 0000000..49a0a1d --- /dev/null +++ b/lib/model/measurement_export.dart @@ -0,0 +1,33 @@ +part of api; + + +@Entity() +class MeasurementExport { + /* id */ + int id = null; + + /* ID of User */ + int userId = null; + + /* Status of Measurement Export */ + String status = null; + + /* Error message */ + String errorMessage = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + MeasurementExport(); + + @override + String toString() { + return 'MeasurementExport[id=$id, userId=$userId, status=$status, errorMessage=$errorMessage, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/lib/model/measurement_post.dart b/lib/model/measurement_post.dart new file mode 100644 index 0000000..4f48b9a --- /dev/null +++ b/lib/model/measurement_post.dart @@ -0,0 +1,27 @@ +part of api; + + +@Entity() +class MeasurementPost { + /* variable_id */ + int variableId = null; + + /* source_id */ + int sourceId = null; + + /* unit_id */ + int unitId = null; + + /* measurements */ + List measurements = []; + + + MeasurementPost(); + + @override + String toString() { + return 'MeasurementPost[variableId=$variableId, sourceId=$sourceId, unitId=$unitId, measurements=$measurements, ]'; + } + +} + diff --git a/lib/model/measurement_value.dart b/lib/model/measurement_value.dart new file mode 100644 index 0000000..cb9d856 --- /dev/null +++ b/lib/model/measurement_value.dart @@ -0,0 +1,21 @@ +part of api; + + +@Entity() +class MeasurementValue { + /* start_time */ + int startTime = null; + + /* value */ + num value = null; + + + MeasurementValue(); + + @override + String toString() { + return 'MeasurementValue[startTime=$startTime, value=$value, ]'; + } + +} + diff --git a/lib/model/source.dart b/lib/model/source.dart new file mode 100644 index 0000000..788311c --- /dev/null +++ b/lib/model/source.dart @@ -0,0 +1,30 @@ +part of api; + + +@Entity() +class Source { + /* id */ + int id = null; + + /* client_id */ + String clientId = null; + + /* Name of the application or device */ + String name = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + Source(); + + @override + String toString() { + return 'Source[id=$id, clientId=$clientId, name=$name, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/lib/model/unit.dart b/lib/model/unit.dart new file mode 100644 index 0000000..264f8f4 --- /dev/null +++ b/lib/model/unit.dart @@ -0,0 +1,54 @@ +part of api; + + +@Entity() +class Unit { + /* id */ + int id = null; + + /* client_id */ + String clientId = null; + + /* Unit name */ + String name = null; + + /* Unit abbreviation */ + String abbreviatedName = null; + + /* Unit category ID */ + int categoryId = null; + + /* Unit minimum value */ + num minimumValue = null; + + /* Unit maximum value */ + num maximumValue = null; + + /* updated */ + int updated = null; + + /* ID of default unit */ + int defaultUnitId = null; + + /* Value multiplied to */ + num multiply = null; + + /* Value which should be added to convert to default unit */ + num add = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + Unit(); + + @override + String toString() { + return 'Unit[id=$id, clientId=$clientId, name=$name, abbreviatedName=$abbreviatedName, categoryId=$categoryId, minimumValue=$minimumValue, maximumValue=$maximumValue, updated=$updated, defaultUnitId=$defaultUnitId, multiply=$multiply, add=$add, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/lib/model/unit_category.dart b/lib/model/unit_category.dart new file mode 100644 index 0000000..ee46e52 --- /dev/null +++ b/lib/model/unit_category.dart @@ -0,0 +1,27 @@ +part of api; + + +@Entity() +class UnitCategory { + /* id */ + int id = null; + + /* Unit category name */ + String name = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + UnitCategory(); + + @override + String toString() { + return 'UnitCategory[id=$id, name=$name, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/lib/model/unit_conversion.dart b/lib/model/unit_conversion.dart new file mode 100644 index 0000000..a5d16bb --- /dev/null +++ b/lib/model/unit_conversion.dart @@ -0,0 +1,33 @@ +part of api; + + +@Entity() +class UnitConversion { + /* unit_id */ + int unitId = null; + + /* step in the conversion process */ + bool stepNumber = null; + + /* 0 is add and 1 is multiply */ + bool operation = null; + + /* number used in the operation */ + num value = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + UnitConversion(); + + @override + String toString() { + return 'UnitConversion[unitId=$unitId, stepNumber=$stepNumber, operation=$operation, value=$value, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/lib/model/update.dart b/lib/model/update.dart new file mode 100644 index 0000000..12ac968 --- /dev/null +++ b/lib/model/update.dart @@ -0,0 +1,39 @@ +part of api; + + +@Entity() +class Update { + /* id */ + int id = null; + + /* user_id */ + int userId = null; + + /* connector_id */ + int connectorId = null; + + /* number_of_measurements */ + int numberOfMeasurements = null; + + /* success */ + bool success = null; + + /* message */ + String message = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + Update(); + + @override + String toString() { + return 'Update[id=$id, userId=$userId, connectorId=$connectorId, numberOfMeasurements=$numberOfMeasurements, success=$success, message=$message, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/lib/model/user_variable.dart b/lib/model/user_variable.dart new file mode 100644 index 0000000..47b3633 --- /dev/null +++ b/lib/model/user_variable.dart @@ -0,0 +1,171 @@ +part of api; + + +@Entity() +class UserVariable { + /* ID of the parent variable if this variable has any parent */ + int parentId = null; + + /* client_id */ + String clientId = null; + + /* ID of variable */ + int variableId = null; + + /* ID of unit to use for this variable */ + int defaultUnitId = null; + + /* Minimum reasonable value for this variable (uses default unit) */ + num minimumAllowedValue = null; + + /* Maximum reasonable value for this variable (uses default unit) */ + num maximumAllowedValue = null; + + /* Value for replacing null measurements */ + num fillingValue = null; + + /* The Variable this Variable should be joined with. If the variable is joined with some other variable then it is not shown to user in the list of variables */ + int joinWith = null; + + /* How long it takes for a measurement in this variable to take effect */ + int onsetDelay = null; + + /* Estimated duration of time following the onset delay in which a stimulus produces a perceivable effect */ + int durationOfAction = null; + + /* ID of variable category */ + int variableCategoryId = null; + + /* updated */ + int updated = null; + + /* Is variable public */ + int public = null; + + /* A value of 1 indicates that this variable is generally a cause in a causal relationship. An example of a causeOnly variable would be a variable such as Cloud Cover which would generally not be influenced by the behaviour of the user */ + bool causeOnly = null; + + /* 0 -> No filling, 1 -> Use filling-value */ + String fillingType = null; + + /* Number of measurements */ + int numberOfMeasurements = null; + + /* Number of processed measurements */ + int numberOfProcessedMeasurements = null; + + /* Number of measurements at last analysis */ + int measurementsAtLastAnalysis = null; + + /* ID of last Unit */ + int lastUnitId = null; + + /* ID of last original Unit */ + int lastOriginalUnitId = null; + + /* Last Value */ + num lastValue = null; + + /* Last original value which is stored */ + int lastOriginalValue = null; + + /* ID of last source */ + int lastSourceId = null; + + /* Number of correlations for this variable */ + int numberOfCorrelations = null; + + /* status */ + String status = null; + + /* error_message */ + String errorMessage = null; + + /* When this variable or its settings were last updated */ + DateTime lastSuccessfulUpdateTime = null; + + /* Standard deviation */ + num standardDeviation = null; + + /* Variance */ + num variance = null; + + /* Minimum recorded daily value of this variable */ + num minimumRecordedDailyValue = null; + + /* Maximum recorded daily value of this variable */ + num maximumRecordedDailyValue = null; + + /* Mean */ + num mean = null; + + /* Median */ + num median = null; + + /* Most common Unit ID */ + int mostCommonUnitId = null; + + /* Most common value */ + num mostCommonValue = null; + + /* Number of unique daily values */ + num numberOfUniqueDailyValues = null; + + /* Number of changes */ + int numberOfChanges = null; + + /* Skewness */ + num skewness = null; + + /* Kurtosis */ + num kurtosis = null; + + /* Latitude */ + num latitude = null; + + /* Longitude */ + num longitude = null; + + /* Location */ + String location = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + /* Outcome variables (those with `outcome` == 1) are variables for which a human would generally want to identify the influencing factors. These include symptoms of illness, physique, mood, cognitive performance, etc. Generally correlation calculations are only performed on outcome variables */ + bool outcome = null; + + /* Comma-separated list of source names to limit variables to those sources */ + String sources = null; + + /* Earliest source time */ + int earliestSourceTime = null; + + /* Latest source time */ + int latestSourceTime = null; + + /* Earliest measurement time */ + int earliestMeasurementTime = null; + + /* Latest measurement time */ + int latestMeasurementTime = null; + + /* Earliest filling time */ + int earliestFillingTime = null; + + /* Latest filling time */ + int latestFillingTime = null; + + + UserVariable(); + + @override + String toString() { + return 'UserVariable[parentId=$parentId, clientId=$clientId, variableId=$variableId, defaultUnitId=$defaultUnitId, minimumAllowedValue=$minimumAllowedValue, maximumAllowedValue=$maximumAllowedValue, fillingValue=$fillingValue, joinWith=$joinWith, onsetDelay=$onsetDelay, durationOfAction=$durationOfAction, variableCategoryId=$variableCategoryId, updated=$updated, public=$public, causeOnly=$causeOnly, fillingType=$fillingType, numberOfMeasurements=$numberOfMeasurements, numberOfProcessedMeasurements=$numberOfProcessedMeasurements, measurementsAtLastAnalysis=$measurementsAtLastAnalysis, lastUnitId=$lastUnitId, lastOriginalUnitId=$lastOriginalUnitId, lastValue=$lastValue, lastOriginalValue=$lastOriginalValue, lastSourceId=$lastSourceId, numberOfCorrelations=$numberOfCorrelations, status=$status, errorMessage=$errorMessage, lastSuccessfulUpdateTime=$lastSuccessfulUpdateTime, standardDeviation=$standardDeviation, variance=$variance, minimumRecordedDailyValue=$minimumRecordedDailyValue, maximumRecordedDailyValue=$maximumRecordedDailyValue, mean=$mean, median=$median, mostCommonUnitId=$mostCommonUnitId, mostCommonValue=$mostCommonValue, numberOfUniqueDailyValues=$numberOfUniqueDailyValues, numberOfChanges=$numberOfChanges, skewness=$skewness, kurtosis=$kurtosis, latitude=$latitude, longitude=$longitude, location=$location, createdAt=$createdAt, updatedAt=$updatedAt, outcome=$outcome, sources=$sources, earliestSourceTime=$earliestSourceTime, latestSourceTime=$latestSourceTime, earliestMeasurementTime=$earliestMeasurementTime, latestMeasurementTime=$latestMeasurementTime, earliestFillingTime=$earliestFillingTime, latestFillingTime=$latestFillingTime, ]'; + } + +} + diff --git a/lib/model/variable.dart b/lib/model/variable.dart new file mode 100644 index 0000000..cc8daa1 --- /dev/null +++ b/lib/model/variable.dart @@ -0,0 +1,123 @@ +part of api; + + +@Entity() +class Variable { + /* id */ + int id = null; + + /* client_id */ + String clientId = null; + + /* parent_id */ + int parentId = null; + + /* Name of the variable */ + String name = null; + + /* Category of the variable */ + int variableCategoryId = null; + + /* ID of the default unit of measurement to use for this variable */ + int defaultUnitId = null; + + /* How to combine values of this variable (for instance, to see a summary of the values over a month) 0 for sum OR 1 for mean */ + String combinationOperation = null; + + /* filling_value */ + num fillingValue = null; + + /* maximum_allowed_value */ + num maximumAllowedValue = null; + + /* minimum_allowed_value */ + num minimumAllowedValue = null; + + /* onset_delay */ + int onsetDelay = null; + + /* duration_of_action */ + int durationOfAction = null; + + /* public */ + int public = null; + + /* cause_only */ + bool causeOnly = null; + + /* most_common_value */ + num mostCommonValue = null; + + /* most_common_unit_id */ + int mostCommonUnitId = null; + + /* standard_deviation */ + num standardDeviation = null; + + /* variance */ + num variance = null; + + /* mean */ + num mean = null; + + /* median */ + num median = null; + + /* number_of_measurements */ + num numberOfMeasurements = null; + + /* number_of_unique_values */ + num numberOfUniqueValues = null; + + /* skewness */ + num skewness = null; + + /* kurtosis */ + num kurtosis = null; + + /* status */ + String status = null; + + /* error_message */ + String errorMessage = null; + + /* last_successful_update_time */ + DateTime lastSuccessfulUpdateTime = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + /* product_url */ + String productUrl = null; + + /* image_url */ + String imageUrl = null; + + /* price */ + num price = null; + + /* number_of_user_variables */ + int numberOfUserVariables = null; + + /* outcome */ + bool outcome = null; + + /* minimum_recorded_value */ + num minimumRecordedValue = null; + + /* maximum_recorded_value */ + num maximumRecordedValue = null; + + + Variable(); + + @override + String toString() { + return 'Variable[id=$id, clientId=$clientId, parentId=$parentId, name=$name, variableCategoryId=$variableCategoryId, defaultUnitId=$defaultUnitId, combinationOperation=$combinationOperation, fillingValue=$fillingValue, maximumAllowedValue=$maximumAllowedValue, minimumAllowedValue=$minimumAllowedValue, onsetDelay=$onsetDelay, durationOfAction=$durationOfAction, public=$public, causeOnly=$causeOnly, mostCommonValue=$mostCommonValue, mostCommonUnitId=$mostCommonUnitId, standardDeviation=$standardDeviation, variance=$variance, mean=$mean, median=$median, numberOfMeasurements=$numberOfMeasurements, numberOfUniqueValues=$numberOfUniqueValues, skewness=$skewness, kurtosis=$kurtosis, status=$status, errorMessage=$errorMessage, lastSuccessfulUpdateTime=$lastSuccessfulUpdateTime, createdAt=$createdAt, updatedAt=$updatedAt, productUrl=$productUrl, imageUrl=$imageUrl, price=$price, numberOfUserVariables=$numberOfUserVariables, outcome=$outcome, minimumRecordedValue=$minimumRecordedValue, maximumRecordedValue=$maximumRecordedValue, ]'; + } + +} + diff --git a/lib/model/variable_category.dart b/lib/model/variable_category.dart new file mode 100644 index 0000000..b4ab90b --- /dev/null +++ b/lib/model/variable_category.dart @@ -0,0 +1,63 @@ +part of api; + + +@Entity() +class VariableCategory { + /* id */ + int id = null; + + /* Name of the category */ + String name = null; + + /* Value for replacing null measurements */ + num fillingValue = null; + + /* Maximum recorded value of this category */ + num maximumAllowedValue = null; + + /* Minimum recorded value of this category */ + num minimumAllowedValue = null; + + /* How long the effect of a measurement in this variable lasts */ + int durationOfAction = null; + + /* How long it takes for a measurement in this variable to take effect */ + int onsetDelay = null; + + /* How to combine values of this variable (for instance, to see a summary of the values over a month) 0 for sum OR 1 for mean */ + String combinationOperation = null; + + /* updated */ + int updated = null; + + /* A value of 1 indicates that this category is generally a cause in a causal relationship. An example of a causeOnly category would be a category such as Work which would generally not be influenced by the behaviour of the user */ + bool causeOnly = null; + + /* Is category public */ + int public = null; + + /* outcome */ + bool outcome = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + /* Image URL */ + String imageUrl = null; + + /* ID of the default unit for the category */ + int defaultUnitId = null; + + + VariableCategory(); + + @override + String toString() { + return 'VariableCategory[id=$id, name=$name, fillingValue=$fillingValue, maximumAllowedValue=$maximumAllowedValue, minimumAllowedValue=$minimumAllowedValue, durationOfAction=$durationOfAction, onsetDelay=$onsetDelay, combinationOperation=$combinationOperation, updated=$updated, causeOnly=$causeOnly, public=$public, outcome=$outcome, createdAt=$createdAt, updatedAt=$updatedAt, imageUrl=$imageUrl, defaultUnitId=$defaultUnitId, ]'; + } + +} + diff --git a/lib/model/variable_user_source.dart b/lib/model/variable_user_source.dart new file mode 100644 index 0000000..29ced9e --- /dev/null +++ b/lib/model/variable_user_source.dart @@ -0,0 +1,39 @@ +part of api; + + +@Entity() +class VariableUserSource { + /* ID of User */ + int userId = null; + + /* ID of variable */ + int variableId = null; + + /* ID of source */ + int sourceId = null; + + /* Time that this measurement occurred Uses epoch minute (epoch time divided by 60) */ + int timestamp = null; + + /* Earliest measurement time */ + int earliestMeasurementTime = null; + + /* Latest measurement time */ + int latestMeasurementTime = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + VariableUserSource(); + + @override + String toString() { + return 'VariableUserSource[userId=$userId, variableId=$variableId, sourceId=$sourceId, timestamp=$timestamp, earliestMeasurementTime=$earliestMeasurementTime, latestMeasurementTime=$latestMeasurementTime, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/lib/model/vote.dart b/lib/model/vote.dart new file mode 100644 index 0000000..2a3c8f9 --- /dev/null +++ b/lib/model/vote.dart @@ -0,0 +1,39 @@ +part of api; + + +@Entity() +class Vote { + /* id */ + int id = null; + + /* client_id */ + String clientId = null; + + /* ID of User */ + int userId = null; + + /* ID of cause variable */ + int causeId = null; + + /* ID of effect variable */ + int effectId = null; + + /* Value of Vote */ + int value = null; + + /* created_at */ + DateTime createdAt = null; + + /* updated_at */ + DateTime updatedAt = null; + + + Vote(); + + @override + String toString() { + return 'Vote[id=$id, clientId=$clientId, userId=$userId, causeId=$causeId, effectId=$effectId, value=$value, createdAt=$createdAt, updatedAt=$updatedAt, ]'; + } + +} + diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..cbc62b6 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,15 @@ +name: swagger +version: 1.0.0 +description: Swagger API client +dependencies: + http: '>=0.11.1 <0.12.0' + dartson: "^0.2.4" + crypto: "^0.9.0" + intl: "^0.12.4+2" + +dev_dependencies: + guinness: '^0.1.17' + browser: any + +transformers: + - dartson