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 +4 -4
- data/ince-api.gemspec +1 -1
- data/lib/ince-api.rb +1 -0
- data/lib/ince_api/reset_connectivity.rb +36 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2374cc36e7cb009bc8942812d48efa5ca18fda048d2ab37ef6b33a9443b3ca1
|
4
|
+
data.tar.gz: 837ed789a53b270f5c8e9881b62f94e5311efafeb0ca5d0c3a45efeb56f57050
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d22eb5b2262fe60bf237bd1d3bb0f7411386c9275d63d25737b2faa229e4a1756201ca5c3d599bcdb160386a0ed41eb1bcb837504d7d2882a1096cc09cbccd7d
|
7
|
+
data.tar.gz: d1dbb953c2ad80b43653fdd61715295729da61e4c0194c2a883b4d1583ee2358a0b400e6eb6336a5ec4a759aa9e0b89f97a200b627197893b7c9ecbb09b31925
|
data/ince-api.gemspec
CHANGED
data/lib/ince-api.rb
CHANGED
@@ -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.
|
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:
|
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.
|
197
|
+
rubygems_version: 3.2.15
|
197
198
|
signing_key:
|
198
199
|
specification_version: 4
|
199
200
|
summary: 1nce API wrapper
|