pip_clients_smssettings 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 70

Pip.Services Logo
Sms Settings Microservice Client SDK for Dart #

This is a Dart client SDK for pip-services-smssettings microservice.

Download #

Right now the only way to get the microservice is to check it out directly from github repository

git clone git@github.com:pip-services-users/pip-clients-smssettings-dart.git

Pip.Service team is working to implement packaging and make stable releases available for your as zip downloadable archieves.

Contract #

Logical contract of the microservice is presented below. For physical implementation (HTTP/REST), please, refer to documentation of the specific protocol.

class SmsSettingsV1 implements IStringIdentifiable {
  /* Recipient information */
  String id;
  String name;
  String phone;
  String language;

  /* SmsSettings management */
  dynamic subscriptions;
  bool verified;
  String ver_code;
  DateTime ver_expire_time;

  /* Custom fields */
  dynamic custom_hdr;
  dynamic custom_dat;
}

abstract class ISmsSettingsV1 {
  Future<List<SmsSettingsV1>> getSettingsByIds(
      String correlationId, List<String> recipientIds);

  Future<SmsSettingsV1> getSettingsById(String correlationId, String recipientId);

  Future<SmsSettingsV1> getSettingsByPhoneSettings(String correlationId, String phone);

  Future<SmsSettingsV1> setSettings(String correlationId, SmsSettingsV1 settings);

  Future<SmsSettingsV1> setVerifiedSettings(String correlationId, SmsSettingsV1 settings);  

  Future<SmsSettingsV1> setRecipient(String correlationId, String recipientId, String name, String phone, String language);

  Future<SmsSettingsV1> setSubscriptions(String correlationId, String recipientId, dynamic subscriptions);

  Future<SmsSettingsV1> deleteSettingsById(String correlationId, String recipientId);

  Future resendVerification(String correlationId, String recipientId);

  Future verifyPhone(String correlationId, String recipientId, String code);
}

Use #

The easiest way to work with the microservice is to use client SDK.

Define client configuration parameters that match the configuration of the microservice's external API

// Client configuration
var httpConfig = ConfigParams.fromTuples(
	"connection.protocol", "http",
	"connection.host", "localhost",
	"connection.port", 8080
);

Instantiate the client and open connection to the microservice

// Create the client instance
var client = SmsSettingsHttpClientV1(config);

// Configure the client
client.configure(httpConfig);

// Connect to the microservice
try{
  await client.open(null)
}catch() {
  // Error handling...
}       
// Work with the microservice
// ...

Now the client is ready to perform operations

// Create a new settings
final SETTINGS = SmsSettingsV1(
    id: '1',
    name: 'User 1',
    phone: '+1234567890',
    language: 'en',
    verified: false);

    // Create the settings
    try {
      var settings = await client.setSettings('123', SETTINGS);
      // Do something with the returned settings...
    } catch(err) {
      // Error handling...     
    }
// Get the settings
try {
var settings = await client.getSettingsByPhoneSettings(
    null,
    '+1234567890');
    // Do something with settings...

    } catch(err) { // Error handling}
// Verify an sms
try {
    settings1 = SETTINGS;
    settings1.ver_code = '123';  
    await controller.verifySms(null, '1', '123');

    var settings = await client.getSettingsById(
    null,
    '1');
    // Do something with settings...

    } catch(err) { // Error handling}

Acknowledgements #

This microservice was created and currently maintained by

  • Sergey Seroukhov
  • Nuzhnykh Egor.

1.0.0 #

  • Initial version

1.0.1 #

  • Added MemoryClient

example/README.md

Examples for Sms Settings Microservice #

This is a sms settings microservice from Pip.Services library. This microservice keeps settings of sms recipients.

Define client configuration parameters that match the configuration of the microservice's external API

// Client configuration
var httpConfig = ConfigParams.fromTuples(
	"connection.protocol", "http",
	"connection.host", "localhost",
	"connection.port", 8080
);

Instantiate the client and open connection to the microservice

// Create the client instance
var client = SmsSettingsHttpClientV1(config);

// Configure the client
client.configure(httpConfig);

// Connect to the microservice
try{
  await client.open(null)
}catch() {
  // Error handling...
}       
// Work with the microservice
// ...

Now the client is ready to perform operations

// Create a new settings
final SETTINGS = SmsSettingsV1(
    id: '1',
    name: 'User 1',
    phone: '+1234567890',
    language: 'en',
    verified: false);

    // Create the settings
    try {
      var settings = await client.setSettings('123', SETTINGS);
      // Do something with the returned settings...
    } catch(err) {
      // Error handling...     
    }
// Get the settings
try {
var settings = await client.getSettingsByPhoneSettings(
    null,
    '+1234567890');
    // Do something with settings...

    } catch(err) { // Error handling}
// Verify an sms
try {
    settings1 = SETTINGS;
    settings1.ver_code = '123';  
    await controller.verifySms(null, '1', '123');

    var settings = await client.getSettingsById(
    null,
    '1');
    // Do something with settings...

    } catch(err) { // Error handling}

In the help for each class there is a general example of its use. Also one of the quality sources are the source code for the tests.

Use this package as a library

1. Depend on it

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


dependencies:
  pip_clients_smssettings: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:pip_clients_smssettings/pip_clients_smssettings.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Jul 10, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15

Analysis suggestions

Package not compatible with SDK flutter

Because it is not compatible with any of the supported runtimes: flutter-native, flutter-web

Package not compatible with runtime flutter-native on Android

Because:

  • package:pip_clients_smssettings/pip_clients_smssettings.dart that imports:
  • package:pip_clients_smssettings/src/build/build.dart that imports:
  • package:pip_clients_smssettings/src/build/SmsSettingsClientFactory.dart that imports:
  • package:pip_clients_smssettings/src/version1/SmsSettingsMemoryClientV1.dart that imports:
  • package:pip_clients_smssettings/src/version1/ISmsSettingsClientV1.dart that imports:
  • package:pip_services_smssettings/pip_services_smssettings.dart that imports:
  • package:pip_services_smssettings/src/build/build.dart that imports:
  • package:pip_services_smssettings/src/build/SmsSettingsServiceFactory.dart that imports:
  • package:pip_services_smssettings/src/services/version1/SmsSettingsHttpServiceV1.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on Linux

Because:

  • package:pip_clients_smssettings/pip_clients_smssettings.dart that imports:
  • package:pip_clients_smssettings/src/build/build.dart that imports:
  • package:pip_clients_smssettings/src/build/SmsSettingsClientFactory.dart that imports:
  • package:pip_clients_smssettings/src/version1/SmsSettingsMemoryClientV1.dart that imports:
  • package:pip_clients_smssettings/src/version1/ISmsSettingsClientV1.dart that imports:
  • package:pip_services_smssettings/pip_services_smssettings.dart that imports:
  • package:pip_services_smssettings/src/build/build.dart that imports:
  • package:pip_services_smssettings/src/build/SmsSettingsServiceFactory.dart that imports:
  • package:pip_services_smssettings/src/services/version1/SmsSettingsHttpServiceV1.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on Windows

Because:

  • package:pip_clients_smssettings/pip_clients_smssettings.dart that imports:
  • package:pip_clients_smssettings/src/build/build.dart that imports:
  • package:pip_clients_smssettings/src/build/SmsSettingsClientFactory.dart that imports:
  • package:pip_clients_smssettings/src/version1/SmsSettingsMemoryClientV1.dart that imports:
  • package:pip_clients_smssettings/src/version1/ISmsSettingsClientV1.dart that imports:
  • package:pip_services_smssettings/pip_services_smssettings.dart that imports:
  • package:pip_services_smssettings/src/build/build.dart that imports:
  • package:pip_services_smssettings/src/build/SmsSettingsServiceFactory.dart that imports:
  • package:pip_services_smssettings/src/services/version1/SmsSettingsHttpServiceV1.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on iOS

Because:

  • package:pip_clients_smssettings/pip_clients_smssettings.dart that imports:
  • package:pip_clients_smssettings/src/build/build.dart that imports:
  • package:pip_clients_smssettings/src/build/SmsSettingsClientFactory.dart that imports:
  • package:pip_clients_smssettings/src/version1/SmsSettingsMemoryClientV1.dart that imports:
  • package:pip_clients_smssettings/src/version1/ISmsSettingsClientV1.dart that imports:
  • package:pip_services_smssettings/pip_services_smssettings.dart that imports:
  • package:pip_services_smssettings/src/build/build.dart that imports:
  • package:pip_services_smssettings/src/build/SmsSettingsServiceFactory.dart that imports:
  • package:pip_services_smssettings/src/services/version1/SmsSettingsHttpServiceV1.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-native on macOS

Because:

  • package:pip_clients_smssettings/pip_clients_smssettings.dart that imports:
  • package:pip_clients_smssettings/src/build/build.dart that imports:
  • package:pip_clients_smssettings/src/build/SmsSettingsClientFactory.dart that imports:
  • package:pip_clients_smssettings/src/version1/SmsSettingsMemoryClientV1.dart that imports:
  • package:pip_clients_smssettings/src/version1/ISmsSettingsClientV1.dart that imports:
  • package:pip_services_smssettings/pip_services_smssettings.dart that imports:
  • package:pip_services_smssettings/src/build/build.dart that imports:
  • package:pip_services_smssettings/src/build/SmsSettingsServiceFactory.dart that imports:
  • package:pip_services_smssettings/src/services/version1/SmsSettingsHttpServiceV1.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime flutter-web on Web

Because:

  • package:pip_clients_smssettings/pip_clients_smssettings.dart that imports:
  • package:pip_clients_smssettings/src/build/build.dart that imports:
  • package:pip_clients_smssettings/src/build/SmsSettingsClientFactory.dart that imports:
  • package:pip_clients_smssettings/src/version1/SmsSettingsMemoryClientV1.dart that imports:
  • package:pip_clients_smssettings/src/version1/ISmsSettingsClientV1.dart that imports:
  • package:pip_services_smssettings/pip_services_smssettings.dart that imports:
  • package:pip_services_smssettings/src/build/build.dart that imports:
  • package:pip_services_smssettings/src/build/SmsSettingsServiceFactory.dart that imports:
  • package:pip_services_smssettings/src/services/version1/SmsSettingsHttpServiceV1.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime js

Because:

  • package:pip_clients_smssettings/pip_clients_smssettings.dart that imports:
  • package:pip_clients_smssettings/src/build/build.dart that imports:
  • package:pip_clients_smssettings/src/build/SmsSettingsClientFactory.dart that imports:
  • package:pip_clients_smssettings/src/version1/SmsSettingsMemoryClientV1.dart that imports:
  • package:pip_clients_smssettings/src/version1/ISmsSettingsClientV1.dart that imports:
  • package:pip_services_smssettings/pip_services_smssettings.dart that imports:
  • package:pip_services_smssettings/src/build/build.dart that imports:
  • package:pip_services_smssettings/src/build/SmsSettingsServiceFactory.dart that imports:
  • package:pip_services_smssettings/src/services/version1/SmsSettingsHttpServiceV1.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Package not compatible with runtime native-aot

Because:

  • package:pip_clients_smssettings/pip_clients_smssettings.dart that imports:
  • package:pip_clients_smssettings/src/build/build.dart that imports:
  • package:pip_clients_smssettings/src/build/SmsSettingsClientFactory.dart that imports:
  • package:pip_clients_smssettings/src/version1/SmsSettingsMemoryClientV1.dart that imports:
  • package:pip_clients_smssettings/src/version1/ISmsSettingsClientV1.dart that imports:
  • package:pip_services_smssettings/pip_services_smssettings.dart that imports:
  • package:pip_services_smssettings/src/build/build.dart that imports:
  • package:pip_services_smssettings/src/build/SmsSettingsServiceFactory.dart that imports:
  • package:pip_services_smssettings/src/services/version1/SmsSettingsHttpServiceV1.dart that imports:
  • package:pip_services3_commons/pip_services3_commons.dart that imports:
  • package:pip_services3_commons/src/validate/validate.dart that imports:
  • package:pip_services3_commons/src/validate/ProjectionParamsSchema.dart that imports:
  • package:pip_services3_commons/src/validate/ArraySchema.dart that imports:
  • package:pip_services3_commons/src/reflect/ObjectReader.dart that imports:
  • package:pip_services3_commons/src/reflect/PropertyReflector.dart that imports:
  • dart:mirrors

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
angel_framework ^2.1.1 2.1.1
http ^0.12.0 0.12.1
pip_services3_commons >=1.0.5 <2.0.0 1.0.11
pip_services3_components >=1.0.2 <2.0.0 1.0.6
pip_services3_data >=1.0.0 <2.0.0 1.0.6
pip_services3_rpc >=1.0.2 <2.0.0 1.0.7
pip_services_smssettings >=1.0.0 <2.0.0 1.0.0
Transitive dependencies
angel_container 1.1.0
angel_http_exception 1.1.0
angel_model 1.0.3
angel_route 3.1.0+1
async 2.4.2
bson 0.3.2
charcode 1.1.3
code_buffer 1.0.1
collection 1.14.13 1.15.0-nullsafety
combinator 1.1.0
convert 2.1.1
crypto 2.1.5
dart2_constant 1.0.2+dart2
file 5.2.1
fixnum 0.10.11
googleapis_auth 0.2.12
grpc 2.2.0
http2 1.0.0
http_parser 3.1.4
http_server 0.9.8+3
intl 0.16.1
logging 0.11.4
matcher 0.12.8
merge_map 1.0.2
meta 1.2.2 1.3.0-nullsafety
mime 0.9.6+3
mock_request 1.0.7
mongo_dart 0.4.0
mongo_dart_query 0.4.1
more 1.18.2 2.5.0
mustache4dart2 0.1.0
path 1.7.0
pedantic 1.9.2
pip_clients_activities 1.0.0
pip_clients_msgtemplates 1.0.0
pip_services3_container 1.0.3
pip_services3_grpc 1.0.0
pip_services3_mongodb 1.0.4
pip_services_activities 1.0.2
pip_services_msgtemplates 1.0.0
pool 1.4.0
protobuf 1.0.1
quiver 2.1.3
quiver_hashcode 2.0.0
recase 2.0.1 3.0.0
source_span 1.7.0
sprintf 4.0.2
stack_trace 1.9.5
string_scanner 1.0.5
term_glyph 1.1.0
tuple 1.0.3
typed_data 1.2.0 1.3.0-nullsafety
uuid 2.2.0
yaml 2.2.1
Dev dependencies
test >=1.14.2 <2.0.0