tencentcloud-sdk-ruby 0.3.3 → 0.3.4

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
2
  SHA256:
3
- metadata.gz: de048898d122a83d0196714978d88e9827acf2c076d8cc6b2d581473b4e6c08f
4
- data.tar.gz: 9d0d36a10f052c9c4312b67f6a253fdabd4486e1bedcaa7dcaf6e553a22a796e
3
+ metadata.gz: f169c93d2c71967f4fef2b1278c60887acbc4228dd015af3abc8d7eca0cde3b7
4
+ data.tar.gz: 21122698511bbc18f6161b818a216f9194f43e0680825f8e40bd4967eead2ed3
5
5
  SHA512:
6
- metadata.gz: 1bffe812d2c1677dbdc2135049090636ab69b567a1a932abe3ad3e01e311a888cf72d892223c865cf39fd5b2eb3c5027da00ffc680aeeb8ffd2a73da16a282dd
7
- data.tar.gz: 6341579e48b0c0ab5e51887594b77c95d86204ba3822a79731065536f70b521f9d0c0802f04375a6ff1b3ea484a50375e7d888e469f4a161e02f81cc28225ce0
6
+ metadata.gz: 2a6452e0c87da7069004458a69a1ba55490d6338c175e472bdc3c0c2e54bcc74b3ddb4e0ecd29de035ff48120f64b1709f00f762abdad9eb3d4d09a8a70b7ff1
7
+ data.tar.gz: b5523fe9a6cacf1d1740ab5379e1a8d37f1d937a924df3e8c92da156c8280dd71ea3aef51bf78d47faecf3bb957640578d02c79272499f1a5f2b7650d7d9bfef
data/.gitignore CHANGED
@@ -6,6 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
-
9
+ .history/
10
10
  # rspec failure tracking
11
11
  .rspec_status
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tencentcloud-sdk-ruby (0.3.3)
4
+ tencentcloud-sdk-ruby (0.3.4)
5
5
  typhoeus (~> 1.0)
6
6
 
7
7
  GEM
@@ -11,7 +11,7 @@ GEM
11
11
  diff-lcs (1.3)
12
12
  ethon (0.14.0)
13
13
  ffi (>= 1.15.0)
14
- ffi (1.15.1)
14
+ ffi (1.15.3)
15
15
  method_source (1.0.0)
16
16
  pry (0.13.1)
17
17
  coderay (~> 1.1)
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+ require 'base64'
3
+ require 'openssl'
4
+ require 'net/http'
5
+ require 'uri'
6
+ require 'cgi'
7
+ require 'json'
8
+ module TencentCloud
9
+ class TpnsClient
10
+ API_VERSION = '2021-04-22'
11
+ ENDPOINTS = {
12
+ 'gz' => 'https://api.tpns.tencent.com',
13
+ 'sh' => 'https://api.tpns.sh.tencent.com',
14
+ 'hk' => 'https://api.tpns.hk.tencent.com',
15
+ 'sg' => 'https://api.tpns.sgp.tencent.com'
16
+ }
17
+
18
+ def initialize(access_id, secret_key, region)
19
+ @access_id = access_id
20
+ @secret_key = secret_key
21
+ @end_point = ENDPOINTS[region.to_s]
22
+ end
23
+
24
+ def http_request(api_path, data)
25
+ current_timestamp = Time.current.to_i.to_s
26
+ uri = URI.parse("#{@end_point}#{api_path}")
27
+
28
+ request = Net::HTTP::Post.new(uri.to_s)
29
+ request.body = data.to_json
30
+ request.initialize_http_header({AccessId: @access_id, TimeStamp: current_timestamp, Sign: sign(current_timestamp, request.body)})
31
+ request.set_content_type 'application/json'
32
+
33
+ Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
34
+ http.request request
35
+ end
36
+ end
37
+
38
+ def sign(current_timestamp, body)
39
+ Base64.strict_encode64(OpenSSL::HMAC.hexdigest('sha256', @secret_key, "#{current_timestamp}#{@access_id}#{body}"))
40
+ end
41
+ end
42
+ end
@@ -56,7 +56,7 @@ module TencentCloud
56
56
  #################### 房间管理相关接口
57
57
  ## 解散房间
58
58
  ## https://cloud.tencent.com/document/api/647/37088
59
- dissmiss_room: 'DissmissRoom',
59
+ dissmiss_room: 'DismissRoom',
60
60
  ## 移出用户
61
61
  ## https://cloud.tencent.com/document/api/647/40496
62
62
  remove_user: 'RemoveUser',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TencentCloud
4
- VERSION = '0.3.3'
4
+ VERSION = '0.3.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tencentcloud-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - FengCe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
11
+ date: 2021-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -111,6 +111,7 @@ files:
111
111
  - lib/tencent_cloud/common/http/sign.rb
112
112
  - lib/tencent_cloud/ocr/v20181119/ocr_client.rb
113
113
  - lib/tencent_cloud/tms/v20200713/tms_client.rb
114
+ - lib/tencent_cloud/tpns/v20210422/tpns_client.rb
114
115
  - lib/tencent_cloud/trtc/v20190722/trtc_client.rb
115
116
  - lib/tencent_cloud/version.rb
116
117
  - tencent_cloud.gemspec