martin_api 1.0.0

swagger #

Register ### Register siterwell account first #### Account management - api/1/register ## Login ### Call login api to get token from response, and set token on the page top YOUR_TOKEN field then press explore button #### Account management - api/1/login ## Response Structure ### The Envelope Every response is contained by an envelope. That is, each response has a predictable set of keys with which you can expect to interact: json { \"status\": \"success\", \"message\": \".....\", \"results\": { ... } } ## Controller and Device ### Caps(Capability), Props(Property), Status The device management API will send/receive controller/device capability and property to communicate with backend server, and all supported json values are list below http://web.siterwell.co.uk/api/apiDoc.html ##

This Dart package is automatically generated by the Swagger Codegen project:

  • API version: 1.20.1.7
  • Build package: io.swagger.codegen.languages.DartClientCodegen

Requirements #

Dart 1.20.0 or later OR Flutter 0.0.20 or later

Installation & Usage

Github #

If this Dart package is published to Github, please include the following in pubspec.yaml

name: swagger
version: 1.0.0
description: Swagger API client
dependencies:
  swagger:
    git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
      version: 'any'

Local #

To use the package in your local drive, please include the following in pubspec.yaml

dependencies:
  swagger:
    path: /path/to/swagger

Tests #

TODO

Getting Started #

Please follow the installation procedure and then run the following:

import 'package:swagger/api.dart';

// TODO Configure API key authorization: Token
//swagger.api.Configuration.apiKey{'Bearer'} = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//swagger.api.Configuration.apiKeyPrefix{'Bearer'} = "Bearer";

var api_instance = new AccountManagementApi();
var type = type_example; // String | Upload file type
var file = /path/to/file.txt; // MultipartFile | file to upload

try {
    var result = api_instance.apiFileUploadPOST(type, file);
    print(result);
} catch (e) {
    print("Exception when calling AccountManagementApi->apiFileUploadPOST: $e\n");
}

Documentation for API Endpoints #

All URIs are relative to https://api.siterwell.co.uk

ClassMethodHTTP requestDescription
AccountManagementApiapiFileUploadPOSTPOST /api/1/users/fileupload file
AccountManagementApiapiForgotPasswordPOSTPOST /api/1/forgotPassword/User forgot password
AccountManagementApiapiLoginPOSTPOST /api/1/login/User login
AccountManagementApiapiLogoutPOSTPOST /api/1/logout/User logout
AccountManagementApiapiRegisterPOSTPOST /api/1/register/User signup
AccountManagementApiapiResendEmailPOSTPOST /api/1/resendEmail/Resend verification email
AccountManagementApiapiResetPasswordPOSTPOST /api/1/resetPassword/{tokenId}Reset password
AccountManagementApiapiUserDataPOSTPOST /api/1/userData/Update user data
AccountManagementApiapiUsersMeGETGET /api/1/users/me/Get user data
AccountManagementApiapiVerifyEmailPOSTPOST /api/1/verifyEmail/{tokenId}Verify email address
DeviceManagementApiapiControllerCtrlPOSTPOST /api/1/controllers/{controllerId}/ctrl/Control a controller
DeviceManagementApiapiControllerDELETEDELETE /api/1/controllersDelete a controller
DeviceManagementApiapiControllerGETGET /api/1/controllersGet controller info
DeviceManagementApiapiControllerPATCHPATCH /api/1/controllersUpdate a controller
DeviceManagementApiapiControllerPOSTPOST /api/1/controllersAdd a controller
DeviceManagementApiapiControllerPUTPUT /api/1/controllersPut a controller
DeviceManagementApiapiDeviceChannelCtrlPOSTPOST /api/1/controllers/{controllerId}/devices/{devId}/channels/{channelId}/ctrl/Control a channel of a specified device property
DeviceManagementApiapiDeviceCtrlPOSTPOST /api/1/controllers/{controllerId}/devices/{devId}/ctrl/Control a device property
DeviceManagementApiapiDevicesDELETEDELETE /api/1/controllers/{controllerId}/devicesDelete a controller's devices
DeviceManagementApiapiDevicesGetGET /api/1/controllers/{controllerId}/devicesGet devices info
DeviceManagementApiapiDevicesPATCHPATCH /api/1/controllers/{controllerId}/devicesUpdate a controller's devices
DeviceManagementApiapiDevicesPOSTPOST /api/1/controllers/{controllerId}/devicesAdd a controller's devices
DeviceManagementApiapiDevicesPUTPUT /api/1/controllers/{controllerId}/devicesPut a controller's devices
DeviceManagementApiapiGetControllerTimezoneGET /api/1/controllers/{controllerId}/timezoneGet timezone info
DeviceManagementApiapiGetControllerWeatherGET /api/1/controllers/{controllerId}/weatherGet weather info
EventHandleApiapiAlertPOST /api/1/event/controllers/{controllerId}/alertalert handle
EventHandleApiapiBatchHandlePOSTPOST /api/1/event/controllers/{controllerId}/batchHandleBatch handle event
EventHandleApiapiEventDefGETGET /api/1/event/def/event trigger
EventHandleApiapiEventHandlePOST /api/1/event/handleevent trigger
EventHandleApiapiHandleFilePOSTPOST /api/1/event/controllers/{controllerId}/devices/{devId}/fileHandle event with file
FamilyAccountManagementApiapiPrivilegeDELETEDELETE /api/1/controllers/{controllerId}/privilegeDelete a family account
FamilyAccountManagementApiapiPrivilegePATCHPATCH /api/1/controllers/{controllerId}/privilegeUpdate a family account
FamilyAccountManagementApiapiPrivilegePOSTPOST /api/1/controllers/{controllerId}/privilegeAdd a family account
FamilyAccountManagementApiapiPrivilegeResendMailPOST /api/1/controllers/{controllerId}/privilege/sendMailresend invite mail
FamilyAccountManagementApiapiPrivilegesGetGET /api/1/privileges/Get pre-defined family account privileges
LogManagementApiapi1LogsGetGET /api/1/logsGet all controller logs by user
LogManagementApiapiControllerLogsGETGET /api/1/controllers/{controllerId}/logsGet a controller's logs
LogManagementApiapiDeviceLogsGETGET /api/1/controllers/{controllerId}/devices/{devId}/logsGet a device's logs
LogManagementApiapiSyncLogsPOST /api/1/logs/syncsync logs
LogManagementApiapiSyncSnapshotPOSTPOST /api/1/logs/controllers/{controllerId}/devices/{devId}/sync/snapshot/Sync logs with snapshot
ReportManagementApiapiBrandReportGETGET /api/1/brands/{brandName}/reportsGet reports depends on brand name
ReportManagementApiapiBrandTypeReportGETGET /api/1/brands/{brandName}/types/{typeEnum}/reportsGet reports depends on brand name and periodical type
ReportManagementApiapiReportGETGET /api/1/reportsGet reports
ReportManagementApiapiReportSupportFieldsGETGET /api/1/reports/supportFieldsGet support fields of report
RuleManagementApiapiControllerRuleDELETEDELETE /api/1/controllers/{controllerId}/rulesDelete a controller's rules
RuleManagementApiapiControllerRulePATCHPATCH /api/1/controllers/{controllerId}/rulesUpdate a controller's rules
RuleManagementApiapiControllerRulePOSTPOST /api/1/controllers/{controllerId}/rulesAdd a controller's rules
RuleManagementApiapiControllerRuleTriggerPOST /api/1/controllers/{controllerId}/rules/{ruleId}/triggerTrigger a controller's rule manually
RuleManagementApiapiControllerRulessGETGET /api/1/controllers/{controllerId}/rulesGet a controller's rules
RuleManagementApiapiRulesGETGET /api/1/rules/Get all rules of all controllers
StreamingManagementApiapiLiveViewGETGET /api/1/controllers/{controllerId}/devices/{devId}/live/Request live view streaming from camera device
StreamingManagementApiapiPlaylistGETGET /api/1/controllers/{controllerId}/devices/{devId}/playlist/Request playlist of recording from camera device
StreamingManagementApiapiSnapshotGETGET /api/1/controllers/{controllerId}/devices/{devId}/snapshot/Request latest snapshot from camera device
StreamingManagementApiapiSnapshotPOSTPOST /api/1/controllers/{controllerId}/devices/{devId}/snapshot/Upload latest snapshot of camera device
StreamingManagementApiapiStreamingRecordsGETGET /api/1/controllers/{controllerId}/devices/{devId}/records/Retrive streaming records of camera in use
UtilityApiapiControllersFilePOSTPOST /api/1/controllers/{controllerId}/filesupload file
UtilityApiapiGeoIpGetGET /api/1/geoIp/Get geographic information from IP address
UtilityApiapiGeoIpPostPOST /api/1/geoIp/Add geographic information from mobile app
UtilityApiapiGetTimezoneGET /api/1/timezoneGet timezone info
UtilityApiapiGetVersionGET /api/1/version/Get server related version info
UtilityApiapiGetWeatherGET /api/1/weatherGet weather info
UtilityApiapiUtilUploadFilePOST /api/1/upload/fileupload file

Documentation For Models #

Documentation For Authorization #

Token #

  • Type: API key
  • API key parameter name: Bearer
  • Location: HTTP header

Author #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  martin_api: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:martin_api/auth/oauth.dart';
import 'package:martin_api/auth/api_key_auth.dart';
import 'package:martin_api/auth/authentication.dart';
import 'package:martin_api/auth/http_basic_auth.dart';
import 'package:martin_api/api_exception.dart';
import 'package:martin_api/model/device_item_res.dart';
import 'package:martin_api/model/oper_devices_res_results.dart';
import 'package:martin_api/model/dev_property_item.dart';
import 'package:martin_api/model/defined_event_item.dart';
import 'package:martin_api/model/oper_rules_res.dart';
import 'package:martin_api/model/weather_item_main_temp.dart';
import 'package:martin_api/model/condition_item.dart';
import 'package:martin_api/model/weather_item_main.dart';
import 'package:martin_api/model/user_me_res.dart';
import 'package:martin_api/model/get_version_res_results.dart';
import 'package:martin_api/model/mode_item.dart';
import 'package:martin_api/model/privilege_item_priv_group.dart';
import 'package:martin_api/model/inline_response200.dart';
import 'package:martin_api/model/rule_item.dart';
import 'package:martin_api/model/oper_rule_item_res.dart';
import 'package:martin_api/model/weather_item.dart';
import 'package:martin_api/model/reset_password_req.dart';
import 'package:martin_api/model/event_item.dart';
import 'package:martin_api/model/success_res.dart';
import 'package:martin_api/model/get_version_res.dart';
import 'package:martin_api/model/parm_item_array_inner.dart';
import 'package:martin_api/model/weather_item_weather.dart';
import 'package:martin_api/model/rule_id_list.dart';
import 'package:martin_api/model/login_req.dart';
import 'package:martin_api/model/defined_privileges_item.dart';
import 'package:martin_api/model/streaming_url_res.dart';
import 'package:martin_api/model/user_data_item.dart';
import 'package:martin_api/model/get_users_rules_item.dart';
import 'package:martin_api/model/post_snapshot_res.dart';
import 'package:martin_api/model/report_support_fields_res.dart';
import 'package:martin_api/model/get_devices_res_results.dart';
import 'package:martin_api/model/user_item.dart';
import 'package:martin_api/model/defined_events_res_results.dart';
import 'package:martin_api/model/parm_item_array.dart';
import 'package:martin_api/model/timezone_res_results.dart';
import 'package:martin_api/model/weather_res.dart';
import 'package:martin_api/model/get_logs_res.dart';
import 'package:martin_api/model/dnd_item.dart';
import 'package:martin_api/model/action_item.dart';
import 'package:martin_api/model/get_controllers_res.dart';
import 'package:martin_api/model/defined_event_trans_item.dart';
import 'package:martin_api/model/rules.dart';
import 'package:martin_api/model/snapshot_item.dart';
import 'package:martin_api/model/dev_channel_item.dart';
import 'package:martin_api/model/property_item.dart';
import 'package:martin_api/model/report_res.dart';
import 'package:martin_api/model/get_geo_ip_res.dart';
import 'package:martin_api/model/ctrl_item.dart';
import 'package:martin_api/model/get_rules_res_results.dart';
import 'package:martin_api/model/privilege_item.dart';
import 'package:martin_api/model/user_data_req.dart';
import 'package:martin_api/model/oper_rules_res_results.dart';
import 'package:martin_api/model/error_res.dart';
import 'package:martin_api/model/get_user_rules_res.dart';
import 'package:martin_api/model/device_item.dart';
import 'package:martin_api/model/timezone_res.dart';
import 'package:martin_api/model/status_item.dart';
import 'package:martin_api/model/message_res.dart';
import 'package:martin_api/model/defined_privileges_res.dart';
import 'package:martin_api/model/rule_id_list_inner.dart';
import 'package:martin_api/model/controller_item.dart';
import 'package:martin_api/model/defined_events_res.dart';
import 'package:martin_api/model/defined_privileges_res_results.dart';
import 'package:martin_api/model/log_item.dart';
import 'package:martin_api/model/get_controllers_res_results.dart';
import 'package:martin_api/model/report_item.dart';
import 'package:martin_api/model/get_rules_res.dart';
import 'package:martin_api/model/log_item_content.dart';
import 'package:martin_api/model/oper_devices_res.dart';
import 'package:martin_api/model/register_req.dart';
import 'package:martin_api/model/streaming_record_item.dart';
import 'package:martin_api/model/controller_ctrl_req.dart';
import 'package:martin_api/model/hw_info_item.dart';
import 'package:martin_api/model/get_streaming_records_res.dart';
import 'package:martin_api/model/caps_group_item.dart';
import 'package:martin_api/model/privilege_item_in.dart';
import 'package:martin_api/model/get_geo_ip_res_results.dart';
import 'package:martin_api/model/group_item.dart';
import 'package:martin_api/model/simply_event_item.dart';
import 'package:martin_api/model/place_item.dart';
import 'package:martin_api/model/oper_dev_item_res.dart';
import 'package:martin_api/model/get_user_rules_res_results.dart';
import 'package:martin_api/model/parm_item.dart';
import 'package:martin_api/model/controller_ctrl_req_params.dart';
import 'package:martin_api/model/forgot_password_req.dart';
import 'package:martin_api/model/weather_res_errors.dart';
import 'package:martin_api/model/controller_item_res.dart';
import 'package:martin_api/model/get_devices_res.dart';
import 'package:martin_api/model/alert_res.dart';
import 'package:martin_api/model/get_snapshot_res.dart';
import 'package:martin_api/model/geo_item.dart';
import 'package:martin_api/api/streaming_management_api.dart';
import 'package:martin_api/api/account_management_api.dart';
import 'package:martin_api/api/report_management_api.dart';
import 'package:martin_api/api/log_management_api.dart';
import 'package:martin_api/api/device_management_api.dart';
import 'package:martin_api/api/utility_api.dart';
import 'package:martin_api/api/rule_management_api.dart';
import 'package:martin_api/api/event_handle_api.dart';
import 'package:martin_api/api/family_account_management_api.dart';
import 'package:martin_api/api_client.dart';
import 'package:martin_api/api_helper.dart';
import 'package:martin_api/api.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
3
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
40
Overall:
Weighted score of the above. [more]
9
Learn more about scoring.

We analyzed this package on Nov 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health suggestions

Fix lib/api/device_management_api.dart. (-16.51 points)

Analysis of lib/api/device_management_api.dart reported 36 hints, including:

line 34 col 26: Use isNotEmpty instead of length

line 42 col 9: DO use curly braces for all flow control structures.

line 69 col 12: Don't explicitly initialize variables to null.

line 87 col 26: Use isNotEmpty instead of length

line 95 col 9: DO use curly braces for all flow control structures.

Fix lib/api/account_management_api.dart. (-11.33 points)

Analysis of lib/api/account_management_api.dart reported 24 hints, including:

line 14 col 12: Don't explicitly initialize variables to null.

line 35 col 26: Use isNotEmpty instead of length

line 49 col 9: DO use curly braces for all flow control structures.

line 94 col 26: Use isNotEmpty instead of length

line 102 col 9: DO use curly braces for all flow control structures.

Fix lib/api/utility_api.dart. (-10.44 points)

Analysis of lib/api/utility_api.dart reported 22 hints, including:

line 14 col 12: Don't explicitly initialize variables to null.

line 37 col 26: Use isNotEmpty instead of length

line 56 col 9: DO use curly braces for all flow control structures.

line 61 col 9: DO use curly braces for all flow control structures.

line 86 col 12: Don't explicitly initialize variables to null.

Fix additional 105 files with analysis or formatting issues. (-304.07 points)

Additional issues in the following files:

  • lib/model/log_item.dart (16 hints)
  • lib/api/log_management_api.dart (15 hints)
  • lib/api/rule_management_api.dart (15 hints)
  • lib/api/streaming_management_api.dart (15 hints)
  • lib/api/event_handle_api.dart (13 hints)
  • lib/api/family_account_management_api.dart (12 hints)
  • lib/api/report_management_api.dart (12 hints)
  • lib/model/defined_event_item.dart (12 hints)
  • lib/model/streaming_record_item.dart (11 hints)
  • lib/model/get_geo_ip_res_results.dart (10 hints)
  • lib/model/weather_item_main_temp.dart (10 hints)
  • lib/model/rule_item.dart (9 hints)
  • lib/model/action_item.dart (8 hints)
  • lib/model/condition_item.dart (8 hints)
  • lib/model/geo_item.dart (8 hints)
  • lib/model/privilege_item_in.dart (8 hints)
  • lib/model/privilege_item_priv_group.dart (8 hints)
  • lib/model/report_item.dart (8 hints)
  • lib/model/snapshot_item.dart (8 hints)
  • lib/model/timezone_res_results.dart (8 hints)
  • lib/model/weather_item.dart (8 hints)
  • lib/model/controller_item_res.dart (7 hints)
  • lib/model/dnd_item.dart (7 hints)
  • lib/model/event_item.dart (7 hints)
  • lib/model/place_item.dart (7 hints)
  • lib/model/register_req.dart (7 hints)
  • lib/model/streaming_url_res.dart (7 hints)
  • lib/model/weather_item_main.dart (7 hints)
  • lib/model/weather_res_errors.dart (7 hints)
  • lib/model/caps_group_item.dart (6 hints)
  • lib/model/controller_item.dart (6 hints)
  • lib/model/ctrl_item.dart (6 hints)
  • lib/model/defined_events_res.dart (6 hints)
  • lib/model/defined_privileges_res.dart (6 hints)
  • lib/model/dev_property_item.dart (6 hints)
  • lib/model/device_item.dart (6 hints)
  • lib/model/device_item_res.dart (6 hints)
  • lib/model/get_controllers_res.dart (6 hints)
  • lib/model/get_devices_res.dart (6 hints)
  • lib/model/get_geo_ip_res.dart (6 hints)
  • lib/model/get_logs_res.dart (6 hints)
  • lib/model/get_rules_res.dart (6 hints)
  • lib/model/get_user_rules_res.dart (6 hints)
  • lib/model/get_version_res.dart (6 hints)
  • lib/model/group_item.dart (6 hints)
  • lib/model/login_req.dart (6 hints)
  • lib/model/oper_dev_item_res.dart (6 hints)
  • lib/model/oper_devices_res.dart (6 hints)
  • lib/model/oper_rule_item_res.dart (6 hints)
  • lib/model/oper_rules_res.dart (6 hints)
  • lib/model/parm_item_array_inner.dart (6 hints)
  • lib/model/post_snapshot_res.dart (6 hints)
  • lib/model/success_res.dart (6 hints)
  • lib/model/timezone_res.dart (6 hints)
  • lib/model/user_me_res.dart (6 hints)
  • lib/model/weather_res.dart (6 hints)
  • lib/model/alert_res.dart (5 hints)
  • lib/model/controller_ctrl_req_params.dart (5 hints)
  • lib/model/defined_event_trans_item.dart (5 hints)
  • lib/model/dev_channel_item.dart (5 hints)
  • lib/model/error_res.dart (5 hints)
  • lib/model/get_snapshot_res.dart (5 hints)
  • lib/model/get_version_res_results.dart (5 hints)
  • lib/model/hw_info_item.dart (5 hints)
  • lib/model/inline_response200.dart (5 hints)
  • lib/model/message_res.dart (5 hints)
  • lib/model/mode_item.dart (5 hints)
  • lib/model/parm_item.dart (5 hints)
  • lib/model/property_item.dart (5 hints)
  • lib/model/report_res.dart (5 hints)
  • lib/model/report_support_fields_res.dart (5 hints)
  • lib/model/reset_password_req.dart (5 hints)
  • lib/model/simply_event_item.dart (5 hints)
  • lib/model/status_item.dart (5 hints)
  • lib/model/user_data_item.dart (5 hints)
  • lib/model/user_item.dart (5 hints)
  • lib/model/weather_item_weather.dart (5 hints)
  • lib/model/controller_ctrl_req.dart (4 hints)
  • lib/model/defined_privileges_item.dart (4 hints)
  • lib/model/forgot_password_req.dart (4 hints)
  • lib/model/get_streaming_records_res.dart (4 hints)
  • lib/model/get_users_rules_item.dart (4 hints)
  • lib/model/log_item_content.dart (4 hints)
  • lib/model/privilege_item.dart (4 hints)
  • lib/model/rule_id_list_inner.dart (4 hints)
  • lib/api_exception.dart (3 hints)
  • lib/model/defined_events_res_results.dart (3 hints)
  • lib/model/defined_privileges_res_results.dart (3 hints)
  • lib/model/get_controllers_res_results.dart (3 hints)
  • lib/model/get_devices_res_results.dart (3 hints)
  • lib/model/get_rules_res_results.dart (3 hints)
  • lib/model/get_user_rules_res_results.dart (3 hints)
  • lib/model/oper_devices_res_results.dart (3 hints)
  • lib/model/oper_rules_res_results.dart (3 hints)
  • lib/model/parm_item_array.dart (3 hints)
  • lib/model/rule_id_list.dart (3 hints)
  • lib/model/rules.dart (3 hints)
  • lib/model/user_data_req.dart (3 hints)
  • lib/api_client.dart (1 hint)
  • lib/auth/oauth.dart (1 hint)
  • lib/api.dart (Run dartfmt to format lib/api.dart.)
  • lib/api_helper.dart (Run dartfmt to format lib/api_helper.dart.)
  • lib/auth/api_key_auth.dart (Run dartfmt to format lib/auth/api_key_auth.dart.)
  • lib/auth/authentication.dart (Run dartfmt to format lib/auth/authentication.dart.)
  • lib/auth/http_basic_auth.dart (Run dartfmt to format lib/auth/http_basic_auth.dart.)

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (http).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and martin_api.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
http >=0.11.1 <0.12.0 0.11.3+17 0.12.0+2
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6