dadapush_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +79 -0
- data/README.md +105 -0
- data/Rakefile +10 -0
- data/dadapush_client.gemspec +45 -0
- data/docs/Action.md +21 -0
- data/docs/DaDaPushMessageApi.md +218 -0
- data/docs/MessageObject.md +27 -0
- data/docs/MessagePushRequest.md +23 -0
- data/docs/MessagePushResponse.md +17 -0
- data/docs/PageResponseOfMessageObject.md +21 -0
- data/docs/Result.md +21 -0
- data/docs/ResultOfMessageObject.md +21 -0
- data/docs/ResultOfMessagePushResponse.md +21 -0
- data/docs/ResultOfPageResponseOfMessageObject.md +21 -0
- data/git_push.sh +55 -0
- data/lib/dadapush_client.rb +49 -0
- data/lib/dadapush_client/api/da_da_push_message_api.rb +292 -0
- data/lib/dadapush_client/api_client.rb +385 -0
- data/lib/dadapush_client/api_error.rb +57 -0
- data/lib/dadapush_client/configuration.rb +241 -0
- data/lib/dadapush_client/models/action.rb +328 -0
- data/lib/dadapush_client/models/message_object.rb +269 -0
- data/lib/dadapush_client/models/message_push_request.rb +300 -0
- data/lib/dadapush_client/models/message_push_response.rb +201 -0
- data/lib/dadapush_client/models/page_response_of_message_object.rb +216 -0
- data/lib/dadapush_client/models/result.rb +224 -0
- data/lib/dadapush_client/models/result_of_message_object.rb +224 -0
- data/lib/dadapush_client/models/result_of_message_push_response.rb +224 -0
- data/lib/dadapush_client/models/result_of_page_response_of_message_object.rb +224 -0
- data/lib/dadapush_client/version.rb +15 -0
- data/spec/api/da_da_push_message_api_spec.rb +88 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/action_spec.rb +57 -0
- data/spec/models/message_object_spec.rb +71 -0
- data/spec/models/message_push_request_spec.rb +59 -0
- data/spec/models/message_push_response_spec.rb +41 -0
- data/spec/models/page_response_of_message_object_spec.rb +53 -0
- data/spec/models/result_of_message_object_spec.rb +53 -0
- data/spec/models/result_of_message_push_response_spec.rb +53 -0
- data/spec/models/result_of_page_response_of_message_object_spec.rb +53 -0
- data/spec/models/result_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- metadata +282 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b357b14e231875744e78f16f7039f350ea784e37
|
4
|
+
data.tar.gz: 8effaad8dcaccc4ca8ac48424c5555a146e1f726
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: '058ff8f6f06f3d3d1bc6da75478d884a901bb6d27f527355a886623f036aa5a3299966bf71478ebf7d7d7e4ecd304dcb9a0f3774ca4147513067d5db47fed243'
|
7
|
+
data.tar.gz: 8e0e9a4655a224910957bf96d959ed141d99f45c9e9a5136354a4fcec40c4b31a402853e4da202168ecde60c96ffd3eb68f1697400901368a6292b01fb73c14d
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
dadapush_client (1.0.0)
|
5
|
+
json (~> 2.1, >= 2.1.0)
|
6
|
+
typhoeus (~> 1.0, >= 1.0.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ZenTest (4.11.2)
|
12
|
+
addressable (2.5.2)
|
13
|
+
public_suffix (>= 2.0.2, < 4.0)
|
14
|
+
autotest (4.4.6)
|
15
|
+
ZenTest (>= 4.4.1)
|
16
|
+
autotest-fsevent (0.2.14)
|
17
|
+
sys-uname
|
18
|
+
autotest-growl (0.2.16)
|
19
|
+
autotest-rails-pure (4.1.2)
|
20
|
+
byebug (10.0.2)
|
21
|
+
coderay (1.1.2)
|
22
|
+
crack (0.4.3)
|
23
|
+
safe_yaml (~> 1.0.0)
|
24
|
+
diff-lcs (1.3)
|
25
|
+
ethon (0.11.0)
|
26
|
+
ffi (>= 1.3.0)
|
27
|
+
ffi (1.9.25)
|
28
|
+
hashdiff (0.3.7)
|
29
|
+
json (2.1.0)
|
30
|
+
method_source (0.9.0)
|
31
|
+
pry (0.11.3)
|
32
|
+
coderay (~> 1.1.0)
|
33
|
+
method_source (~> 0.9.0)
|
34
|
+
pry-byebug (3.6.0)
|
35
|
+
byebug (~> 10.0)
|
36
|
+
pry (~> 0.10)
|
37
|
+
public_suffix (3.0.3)
|
38
|
+
rake (12.0.0)
|
39
|
+
rspec (3.8.0)
|
40
|
+
rspec-core (~> 3.8.0)
|
41
|
+
rspec-expectations (~> 3.8.0)
|
42
|
+
rspec-mocks (~> 3.8.0)
|
43
|
+
rspec-core (3.8.0)
|
44
|
+
rspec-support (~> 3.8.0)
|
45
|
+
rspec-expectations (3.8.1)
|
46
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
+
rspec-support (~> 3.8.0)
|
48
|
+
rspec-mocks (3.8.0)
|
49
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
50
|
+
rspec-support (~> 3.8.0)
|
51
|
+
rspec-support (3.8.0)
|
52
|
+
safe_yaml (1.0.4)
|
53
|
+
sys-uname (1.0.3)
|
54
|
+
ffi (>= 1.0.0)
|
55
|
+
typhoeus (1.3.0)
|
56
|
+
ethon (>= 0.9.0)
|
57
|
+
vcr (3.0.3)
|
58
|
+
webmock (1.24.6)
|
59
|
+
addressable (>= 2.3.6)
|
60
|
+
crack (>= 0.3.2)
|
61
|
+
hashdiff
|
62
|
+
|
63
|
+
PLATFORMS
|
64
|
+
ruby
|
65
|
+
|
66
|
+
DEPENDENCIES
|
67
|
+
autotest (~> 4.4, >= 4.4.6)
|
68
|
+
autotest-fsevent (~> 0.2, >= 0.2.12)
|
69
|
+
autotest-growl (~> 0.2, >= 0.2.16)
|
70
|
+
autotest-rails-pure (~> 4.1, >= 4.1.2)
|
71
|
+
dadapush_client!
|
72
|
+
pry-byebug
|
73
|
+
rake (~> 12.0.0)
|
74
|
+
rspec (~> 3.6, >= 3.6.0)
|
75
|
+
vcr (~> 3.0, >= 3.0.1)
|
76
|
+
webmock (~> 1.24, >= 1.24.3)
|
77
|
+
|
78
|
+
BUNDLED WITH
|
79
|
+
1.16.1
|
data/README.md
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
# dadapush_client
|
2
|
+
|
3
|
+
DaDaPushClient - the Ruby gem for the DaDaPush Public API
|
4
|
+
|
5
|
+
DaDaPush: Real-time Notifications App
|
6
|
+
Send real-time notifications through our API without coding and maintaining your own app for iOS or Android devices.
|
7
|
+
|
8
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
9
|
+
|
10
|
+
- API version: v1
|
11
|
+
- Package version: 1.0.0
|
12
|
+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
13
|
+
For more information, please visit [https://www.dadapush.com](https://www.dadapush.com)
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
### Build a gem
|
18
|
+
|
19
|
+
To build the Ruby code into a gem:
|
20
|
+
|
21
|
+
```shell
|
22
|
+
gem build dadapush_client.gemspec
|
23
|
+
```
|
24
|
+
|
25
|
+
Then either install the gem locally:
|
26
|
+
|
27
|
+
```shell
|
28
|
+
gem install ./dadapush_client-1.0.0.gem
|
29
|
+
```
|
30
|
+
|
31
|
+
(for development, run `gem install --dev ./dadapush_client-1.0.0.gem` to install the development dependencies)
|
32
|
+
|
33
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
34
|
+
|
35
|
+
Finally add this to the Gemfile:
|
36
|
+
|
37
|
+
gem 'dadapush_client', '~> 1.0.0'
|
38
|
+
|
39
|
+
### Install from Git
|
40
|
+
|
41
|
+
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
42
|
+
|
43
|
+
gem 'dadapush_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
44
|
+
|
45
|
+
### Include the Ruby code directly
|
46
|
+
|
47
|
+
Include the Ruby code directly using `-I` as follows:
|
48
|
+
|
49
|
+
```shell
|
50
|
+
ruby -Ilib script.rb
|
51
|
+
```
|
52
|
+
|
53
|
+
## Getting Started
|
54
|
+
|
55
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
# Load the gem
|
59
|
+
require 'dadapush_client'
|
60
|
+
|
61
|
+
api_instance = DaDaPushClient::DaDaPushMessageApi.new
|
62
|
+
body = DaDaPushClient::MessagePushRequest.new # MessagePushRequest | body
|
63
|
+
opts = {
|
64
|
+
x_channel_token: 'x_channel_token_example' # String | see: https://www.dadapush.com/channel/list
|
65
|
+
}
|
66
|
+
|
67
|
+
begin
|
68
|
+
#push Message to a Channel
|
69
|
+
result = api_instance.create_message(body, opts)
|
70
|
+
p result
|
71
|
+
rescue DaDaPushClient::ApiError => e
|
72
|
+
puts "Exception when calling DaDaPushMessageApi->create_message: #{e}"
|
73
|
+
end
|
74
|
+
|
75
|
+
```
|
76
|
+
|
77
|
+
## Documentation for API Endpoints
|
78
|
+
|
79
|
+
All URIs are relative to *https://www.dadapush.com*
|
80
|
+
|
81
|
+
Class | Method | HTTP request | Description
|
82
|
+
------------ | ------------- | ------------- | -------------
|
83
|
+
*DaDaPushClient::DaDaPushMessageApi* | [**create_message**](docs/DaDaPushMessageApi.md#create_message) | **POST** /api/v1/message | push Message to a Channel
|
84
|
+
*DaDaPushClient::DaDaPushMessageApi* | [**delete_message**](docs/DaDaPushMessageApi.md#delete_message) | **DELETE** /api/v1/message/{messageId} | delete a Channel Message
|
85
|
+
*DaDaPushClient::DaDaPushMessageApi* | [**get_message**](docs/DaDaPushMessageApi.md#get_message) | **GET** /api/v1/message/{messageId} | get a Channel Message
|
86
|
+
*DaDaPushClient::DaDaPushMessageApi* | [**get_messages**](docs/DaDaPushMessageApi.md#get_messages) | **GET** /api/v1/messages | get Message List
|
87
|
+
|
88
|
+
|
89
|
+
## Documentation for Models
|
90
|
+
|
91
|
+
- [DaDaPushClient::Action](docs/Action.md)
|
92
|
+
- [DaDaPushClient::MessageObject](docs/MessageObject.md)
|
93
|
+
- [DaDaPushClient::MessagePushRequest](docs/MessagePushRequest.md)
|
94
|
+
- [DaDaPushClient::MessagePushResponse](docs/MessagePushResponse.md)
|
95
|
+
- [DaDaPushClient::PageResponseOfMessageObject](docs/PageResponseOfMessageObject.md)
|
96
|
+
- [DaDaPushClient::Result](docs/Result.md)
|
97
|
+
- [DaDaPushClient::ResultOfMessageObject](docs/ResultOfMessageObject.md)
|
98
|
+
- [DaDaPushClient::ResultOfMessagePushResponse](docs/ResultOfMessagePushResponse.md)
|
99
|
+
- [DaDaPushClient::ResultOfPageResponseOfMessageObject](docs/ResultOfPageResponseOfMessageObject.md)
|
100
|
+
|
101
|
+
|
102
|
+
## Documentation for Authorization
|
103
|
+
|
104
|
+
All endpoints do not require authorization.
|
105
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#DaDaPush Public API
|
5
|
+
|
6
|
+
#DaDaPush: Real-time Notifications App Send real-time notifications through our API without coding and maintaining your own app for iOS or Android devices.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: v1
|
9
|
+
Contact: contacts@dadapush.com
|
10
|
+
Generated by: https://openapi-generator.tech
|
11
|
+
OpenAPI Generator version: 4.0.2
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "dadapush_client/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "dadapush_client"
|
20
|
+
s.version = DaDaPushClient::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["DaDaPush.com"]
|
23
|
+
s.email = ["contacts@dadapush.com"]
|
24
|
+
s.homepage = "https://www.dadapush.com"
|
25
|
+
s.summary = "DaDaPush Client For Ruby"
|
26
|
+
s.description = "DaDaPush: Real-time Notifications App Send real-time notifications through our API without coding and maintaining your own app for iOS or Android devices."
|
27
|
+
s.license = 'Apache 2.0'
|
28
|
+
s.required_ruby_version = ">= 1.9"
|
29
|
+
|
30
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
|
+
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
32
|
+
|
33
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
34
|
+
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
|
35
|
+
s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
|
36
|
+
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
|
37
|
+
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
|
38
|
+
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
|
39
|
+
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
|
40
|
+
|
41
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
42
|
+
s.test_files = `find spec/*`.split("\n")
|
43
|
+
s.executables = []
|
44
|
+
s.require_paths = ["lib"]
|
45
|
+
end
|
data/docs/Action.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# DaDaPushClient::Action
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**name** | **String** | action button name |
|
8
|
+
**type** | **String** | fix value: link |
|
9
|
+
**url** | **String** | action url |
|
10
|
+
|
11
|
+
## Code Sample
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'DaDaPushClient'
|
15
|
+
|
16
|
+
instance = DaDaPushClient::Action.new(name: VIEW,
|
17
|
+
type: link,
|
18
|
+
url: https://www.dadapush.com/)
|
19
|
+
```
|
20
|
+
|
21
|
+
|
@@ -0,0 +1,218 @@
|
|
1
|
+
# DaDaPushClient::DaDaPushMessageApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://www.dadapush.com*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**create_message**](DaDaPushMessageApi.md#create_message) | **POST** /api/v1/message | push Message to a Channel
|
8
|
+
[**delete_message**](DaDaPushMessageApi.md#delete_message) | **DELETE** /api/v1/message/{messageId} | delete a Channel Message
|
9
|
+
[**get_message**](DaDaPushMessageApi.md#get_message) | **GET** /api/v1/message/{messageId} | get a Channel Message
|
10
|
+
[**get_messages**](DaDaPushMessageApi.md#get_messages) | **GET** /api/v1/messages | get Message List
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
## create_message
|
15
|
+
|
16
|
+
> ResultOfMessagePushResponse create_message(body, opts)
|
17
|
+
|
18
|
+
push Message to a Channel
|
19
|
+
|
20
|
+
<h2>Rate Limit:</h2><ul><li>1 request per 1s</li><li>30 request per 1m</li><li>500 request per 1h</li></ul><h2>Result code/errmsg List:</h2><ul><li>0: ok</li><li>1: server error</li><li>101: channel is exists</li><li>102: channel is not exists</li><li>103: channel token error</li><li>104: channel is not exists</li><li>105: message is not exists</li><li>204: bad request</li><li>205: permission deny</li><li>206: too many request, please after 5 minutes to try!</li><li>301: duplicate username/email</li><li>302: user is not exists</li><li>303: user password is error</li><li>304: client push token is error</li><li>305: user is disabled</li><li>306: your subscription is expired</li><li>307: user not subscribe channel</li></ul>
|
21
|
+
|
22
|
+
### Example
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
# load the gem
|
26
|
+
require 'dadapush_client'
|
27
|
+
|
28
|
+
api_instance = DaDaPushClient::DaDaPushMessageApi.new
|
29
|
+
body = DaDaPushClient::MessagePushRequest.new # MessagePushRequest | body
|
30
|
+
opts = {
|
31
|
+
x_channel_token: 'x_channel_token_example' # String | see: https://www.dadapush.com/channel/list
|
32
|
+
}
|
33
|
+
|
34
|
+
begin
|
35
|
+
#push Message to a Channel
|
36
|
+
result = api_instance.create_message(body, opts)
|
37
|
+
p result
|
38
|
+
rescue DaDaPushClient::ApiError => e
|
39
|
+
puts "Exception when calling DaDaPushMessageApi->create_message: #{e}"
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
### Parameters
|
44
|
+
|
45
|
+
|
46
|
+
Name | Type | Description | Notes
|
47
|
+
------------- | ------------- | ------------- | -------------
|
48
|
+
**body** | [**MessagePushRequest**](MessagePushRequest.md)| body |
|
49
|
+
**x_channel_token** | **String**| see: https://www.dadapush.com/channel/list | [optional]
|
50
|
+
|
51
|
+
### Return type
|
52
|
+
|
53
|
+
[**ResultOfMessagePushResponse**](ResultOfMessagePushResponse.md)
|
54
|
+
|
55
|
+
### Authorization
|
56
|
+
|
57
|
+
No authorization required
|
58
|
+
|
59
|
+
### HTTP request headers
|
60
|
+
|
61
|
+
- **Content-Type**: application/json
|
62
|
+
- **Accept**: application/json
|
63
|
+
|
64
|
+
|
65
|
+
## delete_message
|
66
|
+
|
67
|
+
> Result delete_message(message_id, opts)
|
68
|
+
|
69
|
+
delete a Channel Message
|
70
|
+
|
71
|
+
<h2>Rate Limit:</h2><ul><li>10 request per 1s</li><li>100 request per 1m</li><li>1000 request per 1h</li></ul><h2>Result code/errmsg List:</h2><ul><li>0: ok</li><li>1: server error</li><li>101: channel is exists</li><li>102: channel is not exists</li><li>103: channel token error</li><li>104: channel is not exists</li><li>105: message is not exists</li><li>204: bad request</li><li>205: permission deny</li><li>206: too many request, please after 5 minutes to try!</li><li>301: duplicate username/email</li><li>302: user is not exists</li><li>303: user password is error</li><li>304: client push token is error</li><li>305: user is disabled</li><li>306: your subscription is expired</li><li>307: user not subscribe channel</li></ul>
|
72
|
+
|
73
|
+
### Example
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
# load the gem
|
77
|
+
require 'dadapush_client'
|
78
|
+
|
79
|
+
api_instance = DaDaPushClient::DaDaPushMessageApi.new
|
80
|
+
message_id = 56 # Integer | messageId
|
81
|
+
opts = {
|
82
|
+
x_channel_token: 'x_channel_token_example' # String | see: https://www.dadapush.com/channel/list
|
83
|
+
}
|
84
|
+
|
85
|
+
begin
|
86
|
+
#delete a Channel Message
|
87
|
+
result = api_instance.delete_message(message_id, opts)
|
88
|
+
p result
|
89
|
+
rescue DaDaPushClient::ApiError => e
|
90
|
+
puts "Exception when calling DaDaPushMessageApi->delete_message: #{e}"
|
91
|
+
end
|
92
|
+
```
|
93
|
+
|
94
|
+
### Parameters
|
95
|
+
|
96
|
+
|
97
|
+
Name | Type | Description | Notes
|
98
|
+
------------- | ------------- | ------------- | -------------
|
99
|
+
**message_id** | **Integer**| messageId |
|
100
|
+
**x_channel_token** | **String**| see: https://www.dadapush.com/channel/list | [optional]
|
101
|
+
|
102
|
+
### Return type
|
103
|
+
|
104
|
+
[**Result**](Result.md)
|
105
|
+
|
106
|
+
### Authorization
|
107
|
+
|
108
|
+
No authorization required
|
109
|
+
|
110
|
+
### HTTP request headers
|
111
|
+
|
112
|
+
- **Content-Type**: Not defined
|
113
|
+
- **Accept**: application/json
|
114
|
+
|
115
|
+
|
116
|
+
## get_message
|
117
|
+
|
118
|
+
> ResultOfMessageObject get_message(message_id, opts)
|
119
|
+
|
120
|
+
get a Channel Message
|
121
|
+
|
122
|
+
<h2>Rate Limit:</h2><ul><li>10 request per 1s</li><li>100 request per 1m</li><li>1000 request per 1h</li></ul><h2>Result code/errmsg List:</h2><ul><li>0: ok</li><li>1: server error</li><li>101: channel is exists</li><li>102: channel is not exists</li><li>103: channel token error</li><li>104: channel is not exists</li><li>105: message is not exists</li><li>204: bad request</li><li>205: permission deny</li><li>206: too many request, please after 5 minutes to try!</li><li>301: duplicate username/email</li><li>302: user is not exists</li><li>303: user password is error</li><li>304: client push token is error</li><li>305: user is disabled</li><li>306: your subscription is expired</li><li>307: user not subscribe channel</li></ul>
|
123
|
+
|
124
|
+
### Example
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
# load the gem
|
128
|
+
require 'dadapush_client'
|
129
|
+
|
130
|
+
api_instance = DaDaPushClient::DaDaPushMessageApi.new
|
131
|
+
message_id = 56 # Integer | messageId
|
132
|
+
opts = {
|
133
|
+
x_channel_token: 'x_channel_token_example' # String | see: https://www.dadapush.com/channel/list
|
134
|
+
}
|
135
|
+
|
136
|
+
begin
|
137
|
+
#get a Channel Message
|
138
|
+
result = api_instance.get_message(message_id, opts)
|
139
|
+
p result
|
140
|
+
rescue DaDaPushClient::ApiError => e
|
141
|
+
puts "Exception when calling DaDaPushMessageApi->get_message: #{e}"
|
142
|
+
end
|
143
|
+
```
|
144
|
+
|
145
|
+
### Parameters
|
146
|
+
|
147
|
+
|
148
|
+
Name | Type | Description | Notes
|
149
|
+
------------- | ------------- | ------------- | -------------
|
150
|
+
**message_id** | **Integer**| messageId |
|
151
|
+
**x_channel_token** | **String**| see: https://www.dadapush.com/channel/list | [optional]
|
152
|
+
|
153
|
+
### Return type
|
154
|
+
|
155
|
+
[**ResultOfMessageObject**](ResultOfMessageObject.md)
|
156
|
+
|
157
|
+
### Authorization
|
158
|
+
|
159
|
+
No authorization required
|
160
|
+
|
161
|
+
### HTTP request headers
|
162
|
+
|
163
|
+
- **Content-Type**: Not defined
|
164
|
+
- **Accept**: application/json
|
165
|
+
|
166
|
+
|
167
|
+
## get_messages
|
168
|
+
|
169
|
+
> ResultOfPageResponseOfMessageObject get_messages(page, page_size, opts)
|
170
|
+
|
171
|
+
get Message List
|
172
|
+
|
173
|
+
<h2>Rate Limit:</h2><ul><li>1 request per 1s</li><li>45 request per 1m</li></ul><h2>Result code/errmsg List:</h2><ul><li>0: ok</li><li>1: server error</li><li>101: channel is exists</li><li>102: channel is not exists</li><li>103: channel token error</li><li>104: channel is not exists</li><li>105: message is not exists</li><li>204: bad request</li><li>205: permission deny</li><li>206: too many request, please after 5 minutes to try!</li><li>301: duplicate username/email</li><li>302: user is not exists</li><li>303: user password is error</li><li>304: client push token is error</li><li>305: user is disabled</li><li>306: your subscription is expired</li><li>307: user not subscribe channel</li></ul>
|
174
|
+
|
175
|
+
### Example
|
176
|
+
|
177
|
+
```ruby
|
178
|
+
# load the gem
|
179
|
+
require 'dadapush_client'
|
180
|
+
|
181
|
+
api_instance = DaDaPushClient::DaDaPushMessageApi.new
|
182
|
+
page = 1 # Integer | greater than 1
|
183
|
+
page_size = 10 # Integer | range is 1,50
|
184
|
+
opts = {
|
185
|
+
x_channel_token: 'x_channel_token_example' # String | see: https://www.dadapush.com/channel/list
|
186
|
+
}
|
187
|
+
|
188
|
+
begin
|
189
|
+
#get Message List
|
190
|
+
result = api_instance.get_messages(page, page_size, opts)
|
191
|
+
p result
|
192
|
+
rescue DaDaPushClient::ApiError => e
|
193
|
+
puts "Exception when calling DaDaPushMessageApi->get_messages: #{e}"
|
194
|
+
end
|
195
|
+
```
|
196
|
+
|
197
|
+
### Parameters
|
198
|
+
|
199
|
+
|
200
|
+
Name | Type | Description | Notes
|
201
|
+
------------- | ------------- | ------------- | -------------
|
202
|
+
**page** | **Integer**| greater than 1 | [default to 1]
|
203
|
+
**page_size** | **Integer**| range is 1,50 | [default to 10]
|
204
|
+
**x_channel_token** | **String**| see: https://www.dadapush.com/channel/list | [optional]
|
205
|
+
|
206
|
+
### Return type
|
207
|
+
|
208
|
+
[**ResultOfPageResponseOfMessageObject**](ResultOfPageResponseOfMessageObject.md)
|
209
|
+
|
210
|
+
### Authorization
|
211
|
+
|
212
|
+
No authorization required
|
213
|
+
|
214
|
+
### HTTP request headers
|
215
|
+
|
216
|
+
- **Content-Type**: Not defined
|
217
|
+
- **Accept**: application/json
|
218
|
+
|