infobip-sms-api-ruby 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +70 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fixtures/test_single_missing_to.yml +45 -0
- data/fixtures/test_single_network_rejected.yml +45 -0
- data/fixtures/test_single_pending.yml +45 -0
- data/infobip-sms-api-ruby.gemspec +30 -0
- data/lib/generators/infobip/config/config_generator.rb +11 -0
- data/lib/generators/infobip/config/templates/config.rb +10 -0
- data/lib/infobip/sms_api.rb +23 -0
- data/lib/infobip/sms_api/configuration.rb +21 -0
- data/lib/infobip/sms_api/message.rb +36 -0
- data/lib/infobip/sms_api/response.rb +10 -0
- data/lib/infobip/sms_api/response/base.rb +47 -0
- data/lib/infobip/sms_api/response/message.rb +16 -0
- data/lib/infobip/sms_api/response/status.rb +17 -0
- data/lib/infobip/sms_api/version.rb +5 -0
- metadata +164 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7b43de03c663f60a25eb989911f0f548fc26ed4c
|
4
|
+
data.tar.gz: feacbdb85e2e9d47d7f828f02f3da9de30967c3c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1739314c789b282392845ca7dd4db45101f450e256880f492a0bd4c321ab34a366f795f25aaf2e37f956b83757bb360485f3545b8e4ccc3a4f0d82a08ec44ae7
|
7
|
+
data.tar.gz: de3e98178f876fd798da37e3872d57e9702f7ee4e1fe36d8cf8030defb8a6222732583ad2182f51d7f64321985a551a7caca3ca12475d450f4247e9734a1d20a
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at damir@ezyplanet.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Damir Kocic
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# infobip-sms-api-ruby
|
2
|
+
|
3
|
+
Simple API wrapper for Infobip SMS Api
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'infobip-sms-api-ruby'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle install
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install infobip-sms-api-ruby
|
20
|
+
|
21
|
+
Run generator:
|
22
|
+
|
23
|
+
rails g infobip:config
|
24
|
+
|
25
|
+
Generator will create new file config/initializers/infobip_config.rb:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
Infobip::SmsApi.configure do |config|
|
29
|
+
|
30
|
+
# config.endpoint = 'https://api.infobip.com'
|
31
|
+
|
32
|
+
config.username = '' # Infobip Account Username
|
33
|
+
config.password = '' # Infobip Account Password
|
34
|
+
|
35
|
+
# config.debug = false # Log requests and responses
|
36
|
+
|
37
|
+
end
|
38
|
+
```
|
39
|
+
|
40
|
+
To successfully use this gem you need to have Infobip account, and you need to set your username and password.
|
41
|
+
|
42
|
+
## Usage
|
43
|
+
|
44
|
+
### Send single textual message
|
45
|
+
```ruby
|
46
|
+
message = Infobip::SmsApi::Message.new(from: 'Sender', to: '381650000000', text: "Lorem ipsum...")
|
47
|
+
response = message.send_text
|
48
|
+
```
|
49
|
+
|
50
|
+
### Send single textual message to multiple destinations
|
51
|
+
```ruby
|
52
|
+
message = Infobip::SmsApi::Message.new(from: 'Sender', to: ['381650000000','381650000001'], text: "Lorem ipsum...")
|
53
|
+
response = message.send_text
|
54
|
+
```
|
55
|
+
|
56
|
+
## Development
|
57
|
+
|
58
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
59
|
+
|
60
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
61
|
+
|
62
|
+
## Contributing
|
63
|
+
|
64
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/dkocic/infobip-sms-api-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
65
|
+
|
66
|
+
|
67
|
+
## License
|
68
|
+
|
69
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
70
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "infobip/sms/api/ruby"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test:test@api.infobip.com/sms/1/text/single
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"from":"Test","to":"","text":"Testing"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 401
|
21
|
+
message: Unauthorized
|
22
|
+
headers:
|
23
|
+
Access-Control-Allow-Origin:
|
24
|
+
- "*"
|
25
|
+
Access-Control-Allow-Methods:
|
26
|
+
- GET, POST, PUT, PATCH, DELETE, COPY, HEAD, OPTIONS, LINK, UNLINK, PURGE
|
27
|
+
Access-Control-Allow-Headers:
|
28
|
+
- Authorization, Content-Type, X-Enrollment-Token
|
29
|
+
Content-Type:
|
30
|
+
- application/json;charset=UTF-8
|
31
|
+
Content-Length:
|
32
|
+
- '97'
|
33
|
+
Date:
|
34
|
+
- Wed, 09 Mar 2016 19:11:58 GMT
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- SMS API
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: '{"requestError":{"serviceException":{"messageId":"UNAUTHORIZED","text":"Invalid
|
42
|
+
login details"}}}'
|
43
|
+
http_version:
|
44
|
+
recorded_at: Wed, 09 Mar 2016 19:11:58 GMT
|
45
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test:test@api.infobip.com/sms/1/text/single
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"from":"Test","to":"381203136825","text":"Testing"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 401
|
21
|
+
message: Unauthorized
|
22
|
+
headers:
|
23
|
+
Access-Control-Allow-Origin:
|
24
|
+
- "*"
|
25
|
+
Access-Control-Allow-Methods:
|
26
|
+
- GET, POST, PUT, PATCH, DELETE, COPY, HEAD, OPTIONS, LINK, UNLINK, PURGE
|
27
|
+
Access-Control-Allow-Headers:
|
28
|
+
- Authorization, Content-Type, X-Enrollment-Token
|
29
|
+
Content-Type:
|
30
|
+
- application/json;charset=UTF-8
|
31
|
+
Content-Length:
|
32
|
+
- '97'
|
33
|
+
Date:
|
34
|
+
- Wed, 09 Mar 2016 19:11:58 GMT
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- SMS API
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: '{"requestError":{"serviceException":{"messageId":"UNAUTHORIZED","text":"Invalid
|
42
|
+
login details"}}}'
|
43
|
+
http_version:
|
44
|
+
recorded_at: Wed, 09 Mar 2016 19:11:58 GMT
|
45
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://test:test@api.infobip.com/sms/1/text/single
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"from":"Test","to":"31633136825","text":"Testing"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.2
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 401
|
21
|
+
message: Unauthorized
|
22
|
+
headers:
|
23
|
+
Access-Control-Allow-Origin:
|
24
|
+
- "*"
|
25
|
+
Access-Control-Allow-Methods:
|
26
|
+
- GET, POST, PUT, PATCH, DELETE, COPY, HEAD, OPTIONS, LINK, UNLINK, PURGE
|
27
|
+
Access-Control-Allow-Headers:
|
28
|
+
- Authorization, Content-Type, X-Enrollment-Token
|
29
|
+
Content-Type:
|
30
|
+
- application/json;charset=UTF-8
|
31
|
+
Content-Length:
|
32
|
+
- '97'
|
33
|
+
Date:
|
34
|
+
- Wed, 09 Mar 2016 19:11:58 GMT
|
35
|
+
Connection:
|
36
|
+
- close
|
37
|
+
Server:
|
38
|
+
- SMS API
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: '{"requestError":{"serviceException":{"messageId":"UNAUTHORIZED","text":"Invalid
|
42
|
+
login details"}}}'
|
43
|
+
http_version:
|
44
|
+
recorded_at: Wed, 09 Mar 2016 19:11:58 GMT
|
45
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'infobip/sms_api/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "infobip-sms-api-ruby"
|
8
|
+
spec.version = Infobip::SmsApi::VERSION
|
9
|
+
spec.authors = ["dkocic"]
|
10
|
+
spec.email = ["kocicdamir87@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Rails Gem Wrapper for InfoBip SMS API}
|
13
|
+
spec.description = %q{Rails Gem Wrapper for InfoBip SMS API.}
|
14
|
+
spec.homepage = "https://github.com/dkocic/infobip-sms-api-ruby"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_development_dependency "minitest", "~> 5.8"
|
25
|
+
spec.add_development_dependency "vcr", "~> 3.0"
|
26
|
+
spec.add_development_dependency "webmock", "~> 1.24"
|
27
|
+
|
28
|
+
spec.add_dependency "faraday", "~> 0.9"
|
29
|
+
spec.add_dependency "json", "~> 1.8"
|
30
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'infobip/sms_api/version'
|
2
|
+
require 'infobip/sms_api/message'
|
3
|
+
require 'infobip/sms_api/response'
|
4
|
+
require 'infobip/sms_api/configuration'
|
5
|
+
|
6
|
+
module Infobip
|
7
|
+
module SmsApi
|
8
|
+
|
9
|
+
class << self
|
10
|
+
attr_writer :configuration
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.configuration
|
14
|
+
@configuration ||= Configuration.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.configure
|
18
|
+
yield(configuration)
|
19
|
+
configuration.connect
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Infobip
|
2
|
+
module SmsApi
|
3
|
+
class Configuration
|
4
|
+
attr_accessor :username, :password, :endpoint, :connection, :debug
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@endpoint = 'https://api.infobip.com'
|
8
|
+
@debug = false
|
9
|
+
end
|
10
|
+
|
11
|
+
def connect
|
12
|
+
raise 'Username and/or password are not configured' unless @username && @password
|
13
|
+
@connection = Faraday.new(url: @endpoint) do |faraday|
|
14
|
+
faraday.adapter :net_http
|
15
|
+
faraday.response :logger if @debug
|
16
|
+
end
|
17
|
+
@connection.basic_auth @username, @password
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module Infobip
|
5
|
+
module SmsApi
|
6
|
+
class Message
|
7
|
+
|
8
|
+
attr_accessor :from, :to, :text
|
9
|
+
|
10
|
+
def initialize(attributes)
|
11
|
+
self.from = attributes[:from]
|
12
|
+
self.to = attributes[:to]
|
13
|
+
self.text = attributes[:text]
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_hash
|
17
|
+
hash = {}
|
18
|
+
self.instance_variables.each do |var|
|
19
|
+
hash[var.to_s.delete('@')] = self.instance_variable_get(var)
|
20
|
+
end
|
21
|
+
hash
|
22
|
+
end
|
23
|
+
|
24
|
+
def send_text
|
25
|
+
response = Infobip::SmsApi.configuration.connection.post do |req|
|
26
|
+
req.url '/sms/1/text/single'
|
27
|
+
req.body = self.to_hash.to_json
|
28
|
+
req.headers['Accept'] = 'application/json'
|
29
|
+
req.headers['Content-Type'] = 'application/json'
|
30
|
+
end
|
31
|
+
Infobip::SmsApi::Response::Base.new(response.status, JSON.parse(response.body))
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Infobip
|
2
|
+
module SmsApi
|
3
|
+
module Response
|
4
|
+
class Base
|
5
|
+
SUCCESSFUL_STATUSES = %w|PENDING ACCEPTED|
|
6
|
+
attr_reader :messages, :status, :request_error, :data
|
7
|
+
|
8
|
+
def initialize(status, attributes)
|
9
|
+
@status = status
|
10
|
+
@data = attributes
|
11
|
+
case @status
|
12
|
+
when 200
|
13
|
+
@messages = []
|
14
|
+
attributes['messages'].each do |message|
|
15
|
+
@messages << Infobip::SmsApi::Response::Message.new(message)
|
16
|
+
end
|
17
|
+
when 401
|
18
|
+
@request_error = attributes['requestError']
|
19
|
+
else
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
##
|
24
|
+
# Return true if all messages are successfully sent
|
25
|
+
def successful?
|
26
|
+
@messages && (@messages.collect(&:status).collect(&:group_name).uniq - SUCCESSFUL_STATUSES).size == 0
|
27
|
+
end
|
28
|
+
|
29
|
+
##
|
30
|
+
# Return the list of all failed messages
|
31
|
+
def failed_messages
|
32
|
+
@messages.select { |message|
|
33
|
+
!SUCCESSFUL_STATUSES.include?message.status.group_name
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
##
|
38
|
+
# Return the list of all sent messages
|
39
|
+
def sent_messages
|
40
|
+
@messages.select { |message|
|
41
|
+
SUCCESSFUL_STATUSES.include?message.status.group_name
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Infobip
|
2
|
+
module SmsApi
|
3
|
+
module Response
|
4
|
+
class Message
|
5
|
+
attr_reader :to, :status, :sms_count, :message_id
|
6
|
+
|
7
|
+
def initialize(attributes)
|
8
|
+
@to = attributes['to']
|
9
|
+
@status = Infobip::SmsApi::Response::Status.new(attributes['status'])
|
10
|
+
@sms_count = attributes['smsCount']
|
11
|
+
@message_id = attributes['messageId']
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Infobip
|
2
|
+
module SmsApi
|
3
|
+
module Response
|
4
|
+
class Status
|
5
|
+
attr_reader :group_id, :group_name, :id, :name, :description
|
6
|
+
|
7
|
+
def initialize(attributes)
|
8
|
+
@group_id = attributes['groupId']
|
9
|
+
@group_name = attributes['groupName']
|
10
|
+
@id = attributes['id']
|
11
|
+
@name = attributes['name']
|
12
|
+
@description = attributes['description']
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: infobip-sms-api-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- dkocic
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.8'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: vcr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.24'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.24'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: faraday
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.9'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.9'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: json
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.8'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.8'
|
111
|
+
description: Rails Gem Wrapper for InfoBip SMS API.
|
112
|
+
email:
|
113
|
+
- kocicdamir87@gmail.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- CODE_OF_CONDUCT.md
|
120
|
+
- Gemfile
|
121
|
+
- LICENSE.txt
|
122
|
+
- README.md
|
123
|
+
- Rakefile
|
124
|
+
- bin/console
|
125
|
+
- bin/setup
|
126
|
+
- fixtures/test_single_missing_to.yml
|
127
|
+
- fixtures/test_single_network_rejected.yml
|
128
|
+
- fixtures/test_single_pending.yml
|
129
|
+
- infobip-sms-api-ruby.gemspec
|
130
|
+
- lib/generators/infobip/config/config_generator.rb
|
131
|
+
- lib/generators/infobip/config/templates/config.rb
|
132
|
+
- lib/infobip/sms_api.rb
|
133
|
+
- lib/infobip/sms_api/configuration.rb
|
134
|
+
- lib/infobip/sms_api/message.rb
|
135
|
+
- lib/infobip/sms_api/response.rb
|
136
|
+
- lib/infobip/sms_api/response/base.rb
|
137
|
+
- lib/infobip/sms_api/response/message.rb
|
138
|
+
- lib/infobip/sms_api/response/status.rb
|
139
|
+
- lib/infobip/sms_api/version.rb
|
140
|
+
homepage: https://github.com/dkocic/infobip-sms-api-ruby
|
141
|
+
licenses:
|
142
|
+
- MIT
|
143
|
+
metadata: {}
|
144
|
+
post_install_message:
|
145
|
+
rdoc_options: []
|
146
|
+
require_paths:
|
147
|
+
- lib
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
requirements: []
|
159
|
+
rubyforge_project:
|
160
|
+
rubygems_version: 2.4.8
|
161
|
+
signing_key:
|
162
|
+
specification_version: 4
|
163
|
+
summary: Rails Gem Wrapper for InfoBip SMS API
|
164
|
+
test_files: []
|