strongmind-platform-sdk 3.2.0 → 3.4.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
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c093e0e2efe022b81965519f1b7130b60231c84a492b50bb089b65793a60dc06
|
4
|
+
data.tar.gz: 33d39f0115aca3eabbcbae9dc6fb89dafb391d6f6f6d1da582f09117d39de1b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd187124a5476ec2967cecb1e8e1332506e5b8d1a6b0d017d686ae40841bbb1dfaa9b52e4a9e4152644a836db62b8225931cd6ded7d27f94bf4455075e60ad86
|
7
|
+
data.tar.gz: 56ec8877fd3e3c0bafd33ac412d3f7ad6aeb12a6df873394ffbac48af38b7aeda4f9fe99cc7c5f710b56c31bdd49dad503d8d6b69c0a675b84914ef682363f98
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
strongmind-platform-sdk (3.
|
4
|
+
strongmind-platform-sdk (3.4.0)
|
5
5
|
aws-sdk-secretsmanager (~> 1.66)
|
6
6
|
devise
|
7
7
|
faraday (~> 2.5, >= 2.5.2)
|
@@ -40,8 +40,8 @@ GEM
|
|
40
40
|
ast (2.4.2)
|
41
41
|
attr_required (1.0.1)
|
42
42
|
aws-eventstream (1.2.0)
|
43
|
-
aws-partitions (1.
|
44
|
-
aws-sdk-core (3.
|
43
|
+
aws-partitions (1.847.0)
|
44
|
+
aws-sdk-core (3.186.0)
|
45
45
|
aws-eventstream (~> 1, >= 1.0.2)
|
46
46
|
aws-partitions (~> 1, >= 1.651.0)
|
47
47
|
aws-sigv4 (~> 1.5)
|
@@ -56,7 +56,7 @@ GEM
|
|
56
56
|
builder (3.2.4)
|
57
57
|
concurrent-ruby (1.2.2)
|
58
58
|
crass (1.0.6)
|
59
|
-
date (3.3.
|
59
|
+
date (3.3.4)
|
60
60
|
devise (4.9.3)
|
61
61
|
bcrypt (~> 3.0)
|
62
62
|
orm_adapter (~> 0.1)
|
@@ -104,12 +104,12 @@ GEM
|
|
104
104
|
mini_mime (1.1.5)
|
105
105
|
mini_portile2 (2.8.5)
|
106
106
|
minitest (5.18.0)
|
107
|
-
net-imap (0.4.
|
107
|
+
net-imap (0.4.4)
|
108
108
|
date
|
109
109
|
net-protocol
|
110
110
|
net-pop (0.1.2)
|
111
111
|
net-protocol
|
112
|
-
net-protocol (0.2.
|
112
|
+
net-protocol (0.2.2)
|
113
113
|
timeout
|
114
114
|
net-smtp (0.4.0)
|
115
115
|
net-protocol
|
@@ -148,7 +148,7 @@ GEM
|
|
148
148
|
parser (3.2.2.1)
|
149
149
|
ast (~> 2.4.1)
|
150
150
|
public_suffix (5.0.3)
|
151
|
-
racc (1.7.
|
151
|
+
racc (1.7.3)
|
152
152
|
rack (2.2.8)
|
153
153
|
rack-oauth2 (2.2.0)
|
154
154
|
activesupport
|
@@ -218,13 +218,13 @@ GEM
|
|
218
218
|
faraday (~> 2.0)
|
219
219
|
faraday-follow_redirects
|
220
220
|
thor (1.3.0)
|
221
|
-
timeout (0.4.
|
221
|
+
timeout (0.4.1)
|
222
222
|
typhoeus (1.4.0)
|
223
223
|
ethon (>= 0.9.0)
|
224
224
|
tzinfo (2.0.6)
|
225
225
|
concurrent-ruby (~> 1.0)
|
226
226
|
unicode-display_width (2.4.2)
|
227
|
-
uri (0.
|
227
|
+
uri (0.13.0)
|
228
228
|
validate_email (0.1.6)
|
229
229
|
activemodel (>= 3.0)
|
230
230
|
mail (>= 2.2.5)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PlatformSdk
|
4
|
+
module OpsGenie
|
5
|
+
# Client for OpsGenie API
|
6
|
+
class Client
|
7
|
+
attr_reader :connection
|
8
|
+
|
9
|
+
OPSGENIE_API_URL = "https://api.opsgenie.com"
|
10
|
+
|
11
|
+
def initialize(opsgenie_secret, conn = nil)
|
12
|
+
raise ArgumentError, "opsgenie_secret cannot be nil" unless opsgenie_secret
|
13
|
+
|
14
|
+
@connection = conn || build_connection(opsgenie_secret)
|
15
|
+
end
|
16
|
+
|
17
|
+
def heartbeat(heartbeat_name)
|
18
|
+
connection.get("v2/heartbeats/#{heartbeat_name}/ping")
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def build_connection(secret)
|
24
|
+
Faraday.new(url: OPSGENIE_API_URL) do |conn|
|
25
|
+
conn.request :url_encoded
|
26
|
+
conn.request :retry
|
27
|
+
conn.response :raise_error
|
28
|
+
conn.adapter Faraday.default_adapter
|
29
|
+
conn.headers[:Authorization] = "GenieKey #{secret}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -127,6 +127,13 @@ module PlatformSdk
|
|
127
127
|
response.body
|
128
128
|
end
|
129
129
|
|
130
|
+
def update_space(space_id, title: nil)
|
131
|
+
validate_update_space_args(space_id, title)
|
132
|
+
body = { space: { title: title } }
|
133
|
+
response = patch("/spaces/#{space_id}", body.to_json)
|
134
|
+
response.body
|
135
|
+
end
|
136
|
+
|
130
137
|
private
|
131
138
|
|
132
139
|
def build_connection
|
@@ -180,6 +187,11 @@ module PlatformSdk
|
|
180
187
|
end
|
181
188
|
end
|
182
189
|
|
190
|
+
def validate_update_space_args(space_id, title)
|
191
|
+
raise ArgumentError, "space_id must have a value" if space_id.nil?
|
192
|
+
raise ArgumentError, "title must have a value" if title.nil?
|
193
|
+
end
|
194
|
+
|
183
195
|
def validate_api_user_role!(role)
|
184
196
|
return if VALID_API_USER_ROLES.include?(role)
|
185
197
|
|
data/lib/platform_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongmind-platform-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platform Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -199,6 +199,8 @@ files:
|
|
199
199
|
- lib/platform_sdk/identity/clients.rb
|
200
200
|
- lib/platform_sdk/one_roster.rb
|
201
201
|
- lib/platform_sdk/one_roster/client.rb
|
202
|
+
- lib/platform_sdk/ops_genie.rb
|
203
|
+
- lib/platform_sdk/ops_genie/client.rb
|
202
204
|
- lib/platform_sdk/pencil_spaces.rb
|
203
205
|
- lib/platform_sdk/pencil_spaces/client.rb
|
204
206
|
- lib/platform_sdk/pencil_spaces/constants.rb
|
@@ -209,6 +211,7 @@ files:
|
|
209
211
|
- lib/platform_sdk/power_school/special_program.rb
|
210
212
|
- lib/platform_sdk/version.rb
|
211
213
|
- sig/platform_sdk/identity/auth_client.rbs
|
214
|
+
- sig/platform_sdk/ops_genie/client.rbs
|
212
215
|
- sig/platform_sdk/platform_sdk.rbs
|
213
216
|
homepage: https://github.com/StrongMind/platform-ruby-sdk
|
214
217
|
licenses:
|