zeus_sdk 0.6.5 → 0.7.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: b7a3418d18cf6722e211b6d553166c55d2e2a32f10e4375357d0fc99f60d7b4c
4
- data.tar.gz: 1338c6ded7cbe4d3b2238e5752a6814ce7c3efb437630ef2243af43388103f2b
3
+ metadata.gz: dec696694bb7ef88f52a6344a6bb3a191575599dcdfabdaa0f64c2d37bd3452b
4
+ data.tar.gz: ac6bb736937fea7ba3a30f1c4f9e625dad528434d664728cced304658ab447ac
5
5
  SHA512:
6
- metadata.gz: 7b2f4b2e7445d02378bdc7f66756fb533d351dad41f002eca43a0be9cee6d886ebd387161db8f8cc3f5a3d0171943ee49d7775dfbececdf6a3d36a0508e29fe3
7
- data.tar.gz: faf6fd1d9a97628fb1a0ac4cd6019619b49ee2d646735a9d85fdf7ef807bcd8e1c3ffda7aee1c3671787220941238101056e2f39124d94157d266266b8f2f1ed
6
+ metadata.gz: 6705ccd773673ccbeb2f57ba11367d0bd5a26e631f2e3072a6fdb76df6f7cf1aafe14f0df2b6df9035ea3dd7e3416c1d4e11d33a8998a29071ef9f2683d7fecb
7
+ data.tar.gz: 40d4e4fdde7226f92c07aa9142c17ee28c89495166ad31d77bc966aeca94eb0225aed2eefabc17f54acfb4da8bc7e96fc1ef386518f715bccb39caea8e05f685
data/Gemfile CHANGED
@@ -6,4 +6,4 @@ gemspec
6
6
  gem "rake", "~> 12.0"
7
7
  gem "rspec", "~> 3.0"
8
8
  gem "activesupport"
9
- gem "jwt"
9
+ gem "jwt", "~> 2.2.2"
@@ -10,34 +10,34 @@ module ZeusSdk::V1
10
10
 
11
11
  def list_images(query)
12
12
  resp = self.class.get("/api/v1/images", query: query, headers: self.get_headers).parsed_response
13
- return ApiResponse.new(resp)
13
+ return resp
14
14
  end
15
15
 
16
16
  def create_image(image)
17
17
  body = {image: image}
18
18
  resp = self.class.post("/api/v1/images", body: body.to_json, headers: self.get_headers).parsed_response
19
- return ApiResponse.new(resp)
19
+ return resp
20
20
  end
21
21
 
22
22
  def get_image(id)
23
23
  resp = self.class.get("/api/v1/images/#{id}", headers: self.get_headers).parsed_response
24
- return ApiResponse.new(resp)
24
+ return resp
25
25
  end
26
26
 
27
27
  def get_image_variants(id)
28
28
  resp = self.class.get("/api/v1/images/#{id}/variants", headers: self.get_headers).parsed_response
29
- return ApiResponse.new(resp)
29
+ return resp
30
30
  end
31
31
 
32
32
  def update_image(id, image)
33
33
  body = {image: image}
34
34
  resp = self.class.put("/api/v1/images/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
35
- return ApiResponse.new(resp)
35
+ return resp
36
36
  end
37
37
 
38
38
  def destroy_image(id)
39
39
  resp = self.class.delete("/api/v1/images/#{id}", headers: self.get_headers).parsed_response
40
- return ApiResponse.new(resp)
40
+ return resp
41
41
  end
42
42
  end
43
43
  end
@@ -12,46 +12,53 @@ module ZeusSdk::V1
12
12
  def list_users(query)
13
13
  resp = self.class.get("/api/v1/users", query: query, headers: self.get_headers).parsed_response
14
14
 
15
- return ApiResponse.new(resp)
15
+ return resp
16
+ end
17
+
18
+ def login_with_email_password(session)
19
+ body = {user: user}
20
+ resp = self.class.post("/api/v1/sessions", body: body.to_json, headers: self.get_headers).parsed_response
21
+
22
+ return resp
16
23
  end
17
24
 
18
25
  def signup_with_email_password(user)
19
26
  body = {user: user}
20
27
  resp = self.class.post("/api/v1/users", body: body.to_json, headers: self.get_headers).parsed_response
21
28
 
22
- return ApiResponse.new(resp)
29
+ return resp
23
30
  end
24
31
 
25
32
  def get_users(query)
26
33
  resp = self.class.get("/api/v1/users", query: query, headers: self.get_headers).parsed_response
27
34
 
28
- return ApiResponse.new(resp)
35
+ return resp
29
36
  end
30
37
 
31
38
  def get_user(id)
32
39
  resp = self.class.get("/api/v1/users/#{id}", headers: self.get_headers).parsed_response
33
40
 
34
- return ApiResponse.new(resp)
41
+ return resp
35
42
  end
36
43
 
37
44
  def create_user(attributes)
38
45
  body = {user: attributes}
39
46
  resp = self.class.post("/api/v1/users", body: body.to_json, headers: self.get_headers).parsed_response
40
47
 
41
- return ApiResponse.new(resp)
48
+ return resp
42
49
  end
43
50
 
44
51
  def update_user(id, attributes)
45
52
  body = {user: attributes}
46
53
  resp = self.class.put("/api/v1/users/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
47
54
 
48
- return ApiResponse.new(resp)
55
+ return resp
49
56
  end
50
57
 
51
58
  def destroy_user(id)
52
59
  resp = self.class.delete("/api/v1/users/#{id}", headers: self.get_headers).parsed_response
53
60
 
54
- return ApiResponse.new(resp)
61
+ return resp
55
62
  end
56
63
 
57
64
 
@@ -59,33 +66,67 @@ module ZeusSdk::V1
59
66
  def get_waiting_lists(query)
60
67
  resp = self.class.get("/api/v1/waiting_lists", query: query, headers: self.get_headers).parsed_response
61
68
 
62
- return ApiResponse.new(resp)
69
+ return resp
63
70
  end
64
71
 
65
72
  def get_waiting_list(id)
66
73
  resp = self.class.get("/api/v1/waiting_lists/#{id}", headers: self.get_headers).parsed_response
67
74
 
68
- return ApiResponse.new(resp)
75
+ return resp
69
76
  end
70
77
 
71
78
  def create_waiting_list(waiting_list)
72
79
  body = {waiting_list: waiting_list}
73
80
  resp = self.class.post("/api/v1/waiting_lists/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
74
81
 
75
- return ApiResponse.new(resp)
82
+ return resp
76
83
  end
77
84
 
78
85
  def update_waiting_list(id, attributes)
79
86
  body = {waiting_list: attributes}
80
87
  resp = self.class.put("/api/v1/waiting_lists/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
81
88
 
82
- return ApiResponse.new(resp)
89
+ return resp
83
90
  end
84
91
 
85
92
  def destroy_waiting_list(id)
86
93
  resp = self.class.delete("/api/v1/waiting_lists/#{id}", headers: self.get_headers).parsed_response
87
94
 
88
- return ApiResponse.new(resp)
95
+ return resp
96
+ end
97
+
98
+
99
+
100
+ def get_waiting_list_emails(query)
101
+ resp = self.class.get("/api/v1/waiting_list_emails", query: query, headers: self.get_headers).parsed_response
102
+
103
+ return resp
104
+ end
105
+
106
+ def get_waiting_list_email(id)
107
+ resp = self.class.get("/api/v1/waiting_list_emails/#{id}", headers: self.get_headers).parsed_response
108
+
109
+ return resp
110
+ end
111
+
112
+ def create_waiting_list_email(waiting_list_email)
113
+ body = {waiting_list_email: waiting_list_email}
114
+ resp = self.class.post("/api/v1/waiting_list_emails/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
115
+
116
+ return resp
117
+ end
118
+
119
+ def update_waiting_list_email(id, attributes)
120
+ body = {waiting_list_email: attributes}
121
+ resp = self.class.put("/api/v1/waiting_list_emails/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
122
+
123
+ return resp
124
+ end
125
+
126
+ def destroy_waiting_list_email(id)
127
+ resp = self.class.delete("/api/v1/waiting_list_emails/#{id}", headers: self.get_headers).parsed_response
128
+
129
+ return resp
89
130
  end
90
131
 
91
132
 
@@ -93,33 +134,33 @@ module ZeusSdk::V1
93
134
  def get_roles(query)
94
135
  resp = self.class.get("/api/v1/roles", query: query, headers: self.get_headers).parsed_response
95
136
 
96
- return ApiResponse.new(resp)
137
+ return resp
97
138
  end
98
139
 
99
140
  def get_role(id)
100
141
  resp = self.class.get("/api/v1/roles/#{id}", headers: self.get_headers).parsed_response
101
142
 
102
- return ApiResponse.new(resp)
143
+ return resp
103
144
  end
104
145
 
105
146
  def create_role(attributes)
106
147
  body = {role: attributes}
107
148
  resp = self.class.post("/api/v1/roles/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
108
149
 
109
- return ApiResponse.new(resp)
150
+ return resp
110
151
  end
111
152
 
112
153
  def update_role(id, attributes)
113
154
  body = {role: attributes}
114
155
  resp = self.class.put("/api/v1/roles/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
115
156
 
116
- return ApiResponse.new(resp)
157
+ return resp
117
158
  end
118
159
 
119
160
  def destroy_role(id)
120
161
  resp = self.class.delete("/api/v1/roles/#{id}", headers: self.get_headers).parsed_response
121
162
 
122
- return ApiResponse.new(resp)
163
+ return resp
123
164
  end
124
165
 
125
166
 
@@ -127,33 +168,33 @@ module ZeusSdk::V1
127
168
  def get_role_users(query)
128
169
  resp = self.class.get("/api/v1/role_users", query: query, headers: self.get_headers).parsed_response
129
170
 
130
- return ApiResponse.new(resp)
171
+ return resp
131
172
  end
132
173
 
133
174
  def get_role_user(id)
134
175
  resp = self.class.get("/api/v1/role_users/#{id}", headers: self.get_headers).parsed_response
135
176
 
136
- return ApiResponse.new(resp)
177
+ return resp
137
178
  end
138
179
 
139
180
  def create_role_user(attributes)
140
181
  body = {role_user: attributes}
141
182
  resp = self.class.post("/api/v1/role_users/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
142
183
 
143
- return ApiResponse.new(resp)
184
+ return resp
144
185
  end
145
186
 
146
187
  def update_role_user(id, attributes)
147
188
  body = {role_user: attributes}
148
189
  resp = self.class.put("/api/v1/role_users/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
149
190
 
150
- return ApiResponse.new(resp)
191
+ return resp
151
192
  end
152
193
 
153
194
  def destroy_role_user(id)
154
195
  resp = self.class.delete("/api/v1/role_users/#{id}", headers: self.get_headers).parsed_response
155
196
 
156
- return ApiResponse.new(resp)
197
+ return resp
157
198
  end
158
199
 
159
200
 
@@ -161,33 +202,33 @@ module ZeusSdk::V1
161
202
  def get_permissions(query)
162
203
  resp = self.class.get("/api/v1/permissions", query: query, headers: self.get_headers).parsed_response
163
204
 
164
- return ApiResponse.new(resp)
205
+ return resp
165
206
  end
166
207
 
167
208
  def get_permission(id)
168
209
  resp = self.class.get("/api/v1/permissions/#{id}", headers: self.get_headers).parsed_response
169
210
 
170
- return ApiResponse.new(resp)
211
+ return resp
171
212
  end
172
213
 
173
214
  def create_permission(permission)
174
215
  body = {permission: permission}
175
216
  resp = self.class.post("/api/v1/permissions/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
176
217
 
177
- return ApiResponse.new(resp)
218
+ return resp
178
219
  end
179
220
 
180
221
  def update_permission(id, attributes)
181
222
  body = {permission: attributes}
182
223
  resp = self.class.put("/api/v1/permissions/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
183
224
 
184
- return ApiResponse.new(resp)
225
+ return resp
185
226
  end
186
227
 
187
228
  def destroy_permission(id)
188
229
  resp = self.class.delete("/api/v1/permissions/#{id}", headers: self.get_headers).parsed_response
189
230
 
190
- return ApiResponse.new(resp)
231
+ return resp
191
232
  end
192
233
  end
193
234
 
@@ -6,8 +6,6 @@ module ZeusSdk::V1
6
6
  return if raw.blank?
7
7
  self.raw = raw
8
8
  self.success = raw["success"] if raw.has_key?("success")
9
- self.objects = raw["objects"] if raw.has_key?("objects")
10
- self.object = raw["object"] if raw.has_key?("object")
11
9
  self.num_pages = raw["num_pages"] if raw.has_key?("num_pages")
12
10
  self.total = raw["total"] if raw.has_key?("total")
13
11
  self.page = raw["page"] if raw.has_key?("page")
@@ -16,7 +14,7 @@ module ZeusSdk::V1
16
14
 
17
15
  def objects
18
16
  objs = self.raw["objects"]
19
- return nil if objs.blank?
17
+ return [] if objs.blank?
20
18
  case self.type
21
19
  when "Zeus::Auth::User" then objs.map {|obj| User.new(obj) }
22
20
  when "Zeus::Auth::Permission" then objs.map {|obj| Permission.new(obj) }
@@ -1,28 +1,30 @@
1
1
  module ZeusSdk::V1
2
2
  class Image
3
- attr_accessor :raw, :image_id, :urls, :presigned_url, :created_at, :updated_at
3
+ attr_accessor :raw, :image_id, :urls, :presigned_url, :presigned_post, :created_at, :updated_at
4
4
 
5
5
  def initialize(obj)
6
6
  self.raw = obj
7
- self.image_id = obj["id"]
7
+ self.id = obj["id"]
8
8
  self.urls = obj["urls"]
9
9
  self.presigned_url = obj["presigned_url"]
10
+ self.presigned_post = obj["presigned_post"]
10
11
  self.created_at = obj["created_at"]
11
12
  self.updated_at = obj["updated_at"]
12
13
  end
13
14
 
14
15
  def as_json(options={})
15
16
  return {
16
- id: self.image_id,
17
+ id: self.id,
17
18
  urls: self.urls,
18
19
  presigned_url: self.presigned_url,
20
+ presigned_post: self.presigned_post,
19
21
  created_at: self.created_at,
20
22
  updated_at: self.updated_at
21
23
  }
22
24
  end
23
25
 
24
26
  def to_s
25
- "Image(id: #{self.image_id}, presigned_url: #{self.presigned_url}, urls: #{self.urls})"
27
+ "Image(id: #{self.image_id}, urls: #{self.urls})"
26
28
  end
27
29
  end
28
30
  end
@@ -1,6 +1,6 @@
1
1
  module ZeusSdk::V1
2
2
  class User
3
- attr_accessor :raw, :user_id, :name, :email, :email_verified, :first_name, :last_name, :created_at, :updated_at
3
+ attr_accessor :raw, :user_id, :name, :email, :email_verified, :first_name, :last_name, :created_at, :updated_at, :touched_at, :deleted_at
4
4
 
5
5
  def initialize(user)
6
6
  return if user.blank?
@@ -13,6 +13,8 @@ module ZeusSdk::V1
13
13
  self.email_verified = user["email_verified"] if user.has_key?("email_verified")
14
14
  self.created_at = user["created_at"] if user.has_key?("created_at")
15
15
  self.updated_at = user["updated_at"] if user.has_key?("updated_at")
16
+ self.touched_at = user["touched_at"] if user.has_key?("touched_at")
17
+ self.deleted_at = user["deleted_at"] if user.has_key?("deleted_at")
16
18
  end
17
19
 
18
20
  def as_json(options={})
@@ -24,7 +26,9 @@ module ZeusSdk::V1
24
26
  email: self.email,
25
27
  email_verified: self.email_verified,
26
28
  created_at: self.created_at,
27
- updated_at: self.updated_at
29
+ updated_at: self.updated_at,
30
+ touched_at: self.touched_at,
31
+ deleted_at: self.deleted_at
28
32
  }
29
33
  end
30
34
 
@@ -10,55 +10,55 @@ module ZeusSdk::V1
10
10
 
11
11
  def list_documents(query)
12
12
  resp = self.class.get("/api/v1/documents", query: query, headers: self.get_headers).parsed_response
13
- return ApiResponse.new(resp)
13
+ return resp
14
14
  end
15
15
 
16
16
  def create_document(document)
17
17
  body = {document: document}
18
18
  resp = self.class.post("/api/v1/documents", body: body.to_json, headers: self.get_headers).parsed_response
19
- return ApiResponse.new(resp)
19
+ return resp
20
20
  end
21
21
 
22
22
  def get_document(id)
23
23
  resp = self.class.get("/api/v1/documents/#{id}", headers: self.get_headers).parsed_response
24
- return ApiResponse.new(resp)
24
+ return resp
25
25
  end
26
26
 
27
27
  def update_document(id, document)
28
28
  body = {document: document}
29
29
  resp = self.class.put("/api/v1/documents/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
30
- return ApiResponse.new(resp)
30
+ return resp
31
31
  end
32
32
 
33
33
  def destroy_document(id)
34
34
  resp = self.class.delete("/api/v1/documents/#{id}", headers: self.get_headers).parsed_response
35
- return ApiResponse.new(resp)
35
+ return resp
36
36
  end
37
37
 
38
38
  def list_nodes(query)
39
39
  resp = self.class.get("/api/v1/nodes", query: query, headers: self.get_headers).parsed_response
40
- return ApiResponse.new(resp)
40
+ return resp
41
41
  end
42
42
 
43
43
  def create_node(node)
44
44
  body = {node: node}
45
45
  resp = self.class.post("/api/v1/nodes", body: body.to_json, headers: self.get_headers).parsed_response
46
- return ApiResponse.new(resp)
46
+ return resp
47
47
  end
48
48
 
49
49
  def get_node(id)
50
50
  resp = self.class.get("/api/v1/nodes/#{id}", headers: self.get_headers).parsed_response
51
- return ApiResponse.new(resp)
51
+ return resp
52
52
  end
53
53
 
54
54
  def update_node(id, node)
55
55
  resp = self.class.put("/api/v1/nodes/#{id}", body: {node: node}.to_json, headers: self.get_headers).parsed_response
56
- return ApiResponse.new(resp)
56
+ return resp
57
57
  end
58
58
 
59
59
  def destroy_node(id)
60
60
  resp = self.class.delete("/api/v1/nodes/#{id}", headers: self.get_headers).parsed_response
61
- return ApiResponse.new(resp)
61
+ return resp
62
62
  end
63
63
  end
64
64
 
@@ -10,23 +10,23 @@ module ZeusSdk::V1
10
10
 
11
11
  def list_secrets(query)
12
12
  resp = self.class.get("/api/v1/secrets", query: query, headers: self.get_headers)
13
- return ApiResponse.new(resp)
13
+ return resp
14
14
  end
15
15
 
16
16
  def get_secret(key)
17
17
  resp = self.class.get("/api/v1/secrets/#{key}", headers: self.get_headers)
18
- return ApiResponse.new(resp)
18
+ return resp
19
19
  end
20
20
 
21
21
  def set_secret(key, value)
22
22
  body = {secret: {key: key, value: value}}
23
23
  resp = self.class.post("/api/v1/secrets", body: body.to_json, headers: self.get_headers)
24
- return ApiResponse.new(resp)
24
+ return resp
25
25
  end
26
26
 
27
27
  def delete_secret(key)
28
28
  resp = self.class.post("/api/v1/secrets/#{key}", headers: self.get_headers)
29
- return ApiResponse.new(resp)
29
+ return resp
30
30
  end
31
31
  end
32
32
  end
@@ -1,3 +1,3 @@
1
1
  module ZeusSdk
2
- VERSION = "0.6.5"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zeus_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Campbell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-29 00:00:00.000000000 Z
11
+ date: 2021-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubygems_version: 3.2.3
107
+ rubygems_version: 3.2.15
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Ruby SDK for Zeus APIs