sweep_api 1.1.0

  • Readme
  • Changelog
  • Installing
  • 12

sweep_api #

API definitions for the Sweep server/dashboard.

This Dart package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0-oas3
  • Build package: org.openapitools.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: sweep_api
version: 1.0.0
description: OpenAPI API client
dependencies:
  sweep_api:
    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:
  sweep_api:
    path: /path/to/sweep_api

Tests #

TODO

Getting Started #

Please follow the installation procedure and then run the following:

import 'package:sweep_api/api.dart';

// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';

var api_instance = new EventApi();
var eventRequestBody = new EventRequestBody(); // EventRequestBody | 
var apiKey = apiKey_example; // String | 

try {
    api_instance.addEvent(eventRequestBody, apiKey);
} catch (e) {
    print("Exception when calling EventApi->addEvent: $e\n");
}

Documentation for API Endpoints #

All URIs are relative to https://app.sweephq.com/1.0.0

ClassMethodHTTP requestDescription
EventApiaddEventPOST /eventsRaise an event
EventApigetEventByIdGET /events/{eventId}Find raised event by ID
EventApilistEventsGET /eventsList all received events
ListenerApiaddListenerPOST /listenersCreate a new Listener
ListenerApiaddListenerTemplatePOST /listeners/{listenerId}/templates/{templateId}Associates a Template to a Listener
ListenerApideleteListenerDELETE /listeners/{listenerId}Deletes a Listener
ListenerApideleteListenerTemplateDELETE /listeners/{listenerId}/templates/{templateId}Disassociates a Template from a Listener
ListenerApigetListenerGET /listeners/{listenerId}Get a listener by ID
ListenerApilistListenerTemplatesGET /listeners/{listenerId}/templatesList Templates for Listener
ListenerApilistListenersGET /listenersList all Listeners
ListenerApilistMessagesForActionGET /actions/{listenerActionId}/messagesList all messages
ListenerApiupdateListenerPUT /listeners/{listenerId}Updates a Listener
MessageApigetMessageByIdGET /messages/{messageId}Find message by ID
MessageApilistMessagesGET /messagesList all messages
OrganizationApigetOrganizationInfoGET /organizationGet organization info for the currently authenticated context
TemplateApiaddTemplatePOST /templatesCreate a new Template
TemplateApideleteTemplateDELETE /templates/{templateId}Deletes a Template
TemplateApigetTemplateByIdGET /templates/{templateId}Find Template by ID
TemplateApilistTemplateGET /templatesList all Templates
TemplateApirenderTemplatePOST /templates/{templateId}/renderRenders a template using the provided event parameters
TemplateApiupdateTemplatePUT /templates/{templateId}Update an existing Template
UserApideleteUserDELETE /userDelete user
UserApigetUserInfoGET /userGet user info for the currently authenticated user
UserApiloginUserGET /user/loginLogs user into the system
UserApilogoutUserGET /user/logoutLogs out current logged in user session
UserApiupdateUserPUT /userUpdated user

Documentation For Models #

Documentation For Authorization #

GitHub #

Google #

api_key #

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

Author #

contact@avinium.com

# 1.0.0

- Initial release

# 1.1.0

- bump http dependencies

Use this package as a library

1. Depend on it

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


dependencies:
  sweep_api: ^1.1.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:sweep_api/api.dart';
import 'package:sweep_api/api/event_api.dart';
import 'package:sweep_api/api/listener_api.dart';
import 'package:sweep_api/api/message_api.dart';
import 'package:sweep_api/api/organization_api.dart';
import 'package:sweep_api/api/template_api.dart';
import 'package:sweep_api/api/user_api.dart';
import 'package:sweep_api/api_client.dart';
import 'package:sweep_api/api_exception.dart';
import 'package:sweep_api/api_helper.dart';
import 'package:sweep_api/auth/api_key_auth.dart';
import 'package:sweep_api/auth/authentication.dart';
import 'package:sweep_api/auth/http_basic_auth.dart';
import 'package:sweep_api/auth/oauth.dart';
import 'package:sweep_api/model/base_message.dart';
import 'package:sweep_api/model/event.dart';
import 'package:sweep_api/model/event_request_body.dart';
import 'package:sweep_api/model/listener.dart';
import 'package:sweep_api/model/listener_action.dart';
import 'package:sweep_api/model/listener_request_body.dart';
import 'package:sweep_api/model/listener_template.dart';
import 'package:sweep_api/model/message.dart';
import 'package:sweep_api/model/organization.dart';
import 'package:sweep_api/model/render_template_request_body.dart';
import 'package:sweep_api/model/template.dart';
import 'package:sweep_api/model/template_request_body.dart';
import 'package:sweep_api/model/user.dart';
import 'package:sweep_api/model/user_request_body.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
27
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
20
Overall:
Weighted score of the above. [more]
12
Learn more about scoring.

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

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health suggestions

Fix lib/api/listener_api.dart. (-20.99 points)

Analysis of lib/api/listener_api.dart reported 47 hints, including:

line 18 col 12: Unnecessary new keyword.

line 31 col 26: Use isNotEmpty instead of length

line 36 col 29: Unnecessary new keyword.

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

line 53 col 13: Unnecessary new keyword.

Fix lib/api/template_api.dart. (-14.39 points)

Analysis of lib/api/template_api.dart reported 31 hints, including:

line 18 col 12: Unnecessary new keyword.

line 31 col 26: Use isNotEmpty instead of length

line 36 col 29: Unnecessary new keyword.

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

line 53 col 13: Unnecessary new keyword.

Fix lib/api/user_api.dart. (-10.89 points)

Analysis of lib/api/user_api.dart reported 23 hints, including:

line 28 col 26: Use isNotEmpty instead of length

line 33 col 29: Unnecessary new keyword.

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

line 50 col 13: Unnecessary new keyword.

line 74 col 26: Use isNotEmpty instead of length

Fix additional 25 files with analysis or formatting issues. (-78.72 points)

Additional issues in the following files:

  • lib/api/event_api.dart (14 hints)
  • lib/model/message.dart (13 hints)
  • lib/model/template.dart (13 hints)
  • lib/model/listener.dart (12 hints)
  • lib/model/base_message.dart (11 hints)
  • lib/model/event.dart (11 hints)
  • lib/model/listener_action.dart (10 hints)
  • lib/model/listener_request_body.dart (10 hints)
  • lib/api/message_api.dart (9 hints)
  • lib/model/template_request_body.dart (9 hints)
  • lib/model/user.dart (9 hints)
  • lib/model/listener_template.dart (8 hints)
  • lib/model/organization.dart (8 hints)
  • lib/model/event_request_body.dart (6 hints)
  • lib/model/user_request_body.dart (6 hints)
  • lib/model/render_template_request_body.dart (5 hints)
  • lib/api/organization_api.dart (4 hints)
  • lib/api.dart (1 hint)
  • lib/api_client.dart (1 hint)
  • lib/api_helper.dart (1 hint)
  • lib/api_exception.dart (Run dartfmt to format lib/api_exception.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.)
  • lib/auth/oauth.dart (Run dartfmt to format lib/auth/oauth.dart.)

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: dson.

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://sweephq.com was unreachable.

Use analysis_options.yaml. (-10 points)

Change the name of your package's .analysis_options file to analysis_options.yaml.

Read more about the setup of analysis-options.yaml.

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 sweep_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 >=2.0.0 <3.0.0
dson any 0.16.0
http ^0.12.0 0.12.0+2
Transitive dependencies
_fe_analyzer_shared 1.0.0
analyzer 0.39.1
args 1.5.2
async 2.4.0
build 1.2.2
built_mirrors 0.11.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
csslib 0.16.1
dart_style 1.3.3
front_end 0.1.29
glob 1.2.0
html 0.14.0+3
http_parser 3.1.3
js 0.6.1+1
kernel 0.3.29
logging 0.11.3+2
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
path 1.6.4
pedantic 1.9.0
pub_semver 1.4.2
serializable 0.12.0
source_gen 0.9.4+6
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+13
yaml 2.2.0