totalvoice-ruby 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 42de3c22f84f079f2e6ed307a7d665b57ff492dd
4
- data.tar.gz: 63dd6321eed5272f885867b1878b38f08530d9dd
2
+ SHA256:
3
+ metadata.gz: fd153b5d90c0c587c42d2e4da23c939083828886d74c658ac377a658fc676624
4
+ data.tar.gz: d5aa962d9fbfa74c97aed2f68e35eb223fe23196f7d551b1592188bd6b76d438
5
5
  SHA512:
6
- metadata.gz: 355d1c010cc396c12a761edb80a7a73a26ec6128b6b63b7b74803a5f293fe8b9281ff4e8caa816663e19c76fd912a03cfc636207dd2eca29d3953ab88cf1e473
7
- data.tar.gz: da8c62a81fe2b53150a5ea0bd5158cce711e2c3cab7c3400a0bada49ac180e19ed68b989bef50a32cabfcc9f64b30520c6f0984e790b5a59c0ff4fd9014f8faf
6
+ metadata.gz: c553626c281e9a78edbafebcf3ef7a1ef7b5945e4aec2cbba5b577f87a74d65c8684d453928ef8d206c571981e227877afd345959132151e71e42eb305d43131
7
+ data.tar.gz: 950b21e20b4aa92f3be3b04054312e1f2fe3c2be045d92771df418102b253a29cdf96f76cfd0f3388b0c7e76eb2d13d68b2d7b9995fcd4cee60886405371d3cc
data/.gitignore CHANGED
@@ -11,6 +11,7 @@
11
11
  /tmp/
12
12
  /testes/
13
13
  .idea/
14
+ teste.rb
14
15
 
15
16
  # Used by dotenv library to load environment variables.
16
17
  # .env
@@ -6,6 +6,7 @@ module TotalVoice
6
6
  class Conta
7
7
  attr_reader :client
8
8
  ROTA_CONTA = "/conta"
9
+ ROTA_WEBHOOK_DEFAULT = "/webhook-default"
9
10
 
10
11
  def initialize(client)
11
12
  @client = client
@@ -82,6 +83,37 @@ module TotalVoice
82
83
  #
83
84
  def recarga_bonus(id, nome, valor)
84
85
  @client.post(Route.new([ROTA_CONTA, id.to_s, 'bonus']), { nome: nome, valor:valor })
86
+ end
87
+
88
+ ##
89
+ # Retorna a lista de webhooks default configurados para esta conta
90
+ # @return [json]
91
+ #
92
+ def webhooks_default()
93
+ @client.get(Route.new([ROTA_CONTA, ROTA_WEBHOOK_DEFAULT]))
94
+ end
95
+
96
+ ##
97
+ # Apaga um webhook default
98
+ #
99
+ # @param [String] nome
100
+ # @return [json]
101
+ #
102
+ def excluir_webhook_default(nome)
103
+ @client.delete(Route.new([ROTA_CONTA, ROTA_WEBHOOK_DEFAULT, nome]))
104
+ end
105
+
106
+ ##
107
+ # Cadastra ou atualiza um webhook default
108
+ #
109
+ # @param [String] nome
110
+ # @param [String] url
111
+ # @return [json]
112
+ #
113
+ def salvar_webhook_default(nome, url)
114
+ @client.put(Route.new([ROTA_CONTA, ROTA_WEBHOOK_DEFAULT, nome]), {
115
+ url: url
116
+ })
85
117
  end
86
118
  end
87
119
  end
@@ -1,3 +1,3 @@
1
1
  module TotalVoice
2
- VERSION = '1.5.1'
2
+ VERSION = '1.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totalvoice-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DiloWagner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-04 00:00:00.000000000 Z
11
+ date: 2020-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project:
86
- rubygems_version: 2.6.14.1
86
+ rubygems_version: 2.7.6
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Official TotalVoice Gem