ince-api 0.0.6 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abcdb5b26135ec182b22cf1956873c243c629662effd4a4bdab08b276694a09a
4
- data.tar.gz: 377ceb1ce19d02c9ffd71488c0fbc9b15d83af165d4d0b6213a58cd2611e7e5b
3
+ metadata.gz: b2374cc36e7cb009bc8942812d48efa5ca18fda048d2ab37ef6b33a9443b3ca1
4
+ data.tar.gz: 837ed789a53b270f5c8e9881b62f94e5311efafeb0ca5d0c3a45efeb56f57050
5
5
  SHA512:
6
- metadata.gz: a62d18dfb5d4e4ffafe305e126a047b878adc33fd2291c7b50f7cedd48d3cc80c7c3484254b85cfc78a653e2a56d391092fc8318ce84824b0dd67c9621b63212
7
- data.tar.gz: fae9f66854afaa3cf34643f14cca899ae306a38dd6d6ed6d7ec91a5bb12e173a9436579fb245e6c4298093de6dafc56c9284af3333b1fab208570a7f5581601c
6
+ metadata.gz: d22eb5b2262fe60bf237bd1d3bb0f7411386c9275d63d25737b2faa229e4a1756201ca5c3d599bcdb160386a0ed41eb1bcb837504d7d2882a1096cc09cbccd7d
7
+ data.tar.gz: d1dbb953c2ad80b43653fdd61715295729da61e4c0194c2a883b4d1583ee2358a0b400e6eb6336a5ec4a759aa9e0b89f97a200b627197893b7c9ecbb09b31925
data/ince-api.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ince-api'
3
- s.version = '0.0.6'
3
+ s.version = '0.1.1'
4
4
  s.summary = "1nce API wrapper"
5
5
  s.description = "A simple wrapper for 1nce API"
6
6
  s.authors = ["Stanislaw Zawadzki"]
data/lib/ince-api.rb CHANGED
@@ -13,3 +13,4 @@ require_relative 'ince_api/get_sim_usage'
13
13
  require_relative 'ince_api/single_sim_configuration'
14
14
  require_relative 'ince_api/multiple_sims_configuration'
15
15
  require_relative 'ince_api/create_sms'
16
+ require_relative 'ince_api/reset_connectivity'
@@ -0,0 +1,36 @@
1
+ module InceApi
2
+ class ResetConnectivity
3
+ def initialize(access_token:, iccid:)
4
+ @access_token = access_token
5
+ @iccid = iccid
6
+ end
7
+
8
+ def reset
9
+ response = connection.request(request)
10
+ if response.body != ''
11
+ JSON.parse(response.body)
12
+ else
13
+ {'status_code' => 404, 'error_message' => 'SIM with ICCID not found'}
14
+ end
15
+ end
16
+
17
+ private
18
+
19
+ def url
20
+ @url ||= URI("https://api.1nce.com/management-api/v1/sims/#{@iccid}/reset")
21
+ end
22
+
23
+ def connection
24
+ @connection ||= Net::HTTP.new(url.host, url.port).tap do |http|
25
+ http.use_ssl = true
26
+ end
27
+ end
28
+
29
+ def request
30
+ Net::HTTP::POST.new(url).tap do |request|
31
+ request["Accept"] = 'application/json'
32
+ request['Authorization'] = "Bearer #{@access_token}"
33
+ end
34
+ end
35
+ end
36
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ince-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislaw Zawadzki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-16 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uri
@@ -142,6 +142,7 @@ files:
142
142
  - lib/ince_api/get_sim_usage.rb
143
143
  - lib/ince_api/get_sims.rb
144
144
  - lib/ince_api/multiple_sims_configuration.rb
145
+ - lib/ince_api/reset_connectivity.rb
145
146
  - lib/ince_api/single_sim_configuration.rb
146
147
  - spec/fixtures/vcr_cassettes/create_sms.yml
147
148
  - spec/fixtures/vcr_cassettes/get_sim.yml
@@ -193,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
194
  - !ruby/object:Gem::Version
194
195
  version: '0'
195
196
  requirements: []
196
- rubygems_version: 3.1.4
197
+ rubygems_version: 3.2.15
197
198
  signing_key:
198
199
  specification_version: 4
199
200
  summary: 1nce API wrapper