school21_api_sdk 0.2.0 → 0.3.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 +4 -4
- data/lib/school21/api/campuses_api.rb +67 -0
- data/lib/school21/api/clusters_api.rb +22 -0
- data/lib/school21/api/participants_api.rb +3 -7
- data/lib/school21/api/projects_api.rb +3 -7
- data/lib/school21/client.rb +13 -3
- data/lib/school21/config/client_config.rb +1 -1
- data/lib/school21/version.rb +1 -1
- data/lib/school21.rb +2 -0
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e94bb6054dc91242b21c99220f3c30931f0b6b24418ef8f0ba140052f2220fb3
|
|
4
|
+
data.tar.gz: f4fc58b78bfe7a25291cab9f34de83f5361ecd8afc929a500b7bb4958bbb54a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 379828e0c0f1bc42e3d66751ee73db4163fbaf35232d7200aa7fe552f36c08bf2f31dc702aeeac37cd72d0ea02dff01c0c89937f55284115ca10264d88ce9611
|
|
7
|
+
data.tar.gz: 707c86e1a6fb0bc5b4c92e3f71ed720b3219ddf5c569a5fc4614f7f2c78a96a45356900f6f6df942dad41f89c06ed31cac2e28a6e4caf77f7715bf8ca02657c8
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module School21
|
|
4
|
+
class CampusesApi < BaseApi
|
|
5
|
+
def campuses
|
|
6
|
+
path = '/campuses'
|
|
7
|
+
new_request = new_request_builder(HttpMethod::GET, path, :api_v1)
|
|
8
|
+
.auth(CoreLibrary::Single.new(SINGLE_AUTH_PARTICIPANT))
|
|
9
|
+
|
|
10
|
+
new_api_call_builder
|
|
11
|
+
.request(new_request)
|
|
12
|
+
.response(new_response_handler)
|
|
13
|
+
.execute
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def campuses_participants(campus_id, options: {})
|
|
17
|
+
path = "/campuses/#{campus_id}/participants"
|
|
18
|
+
default_options = { limit: 50, offset: 0 }.merge(options)
|
|
19
|
+
|
|
20
|
+
new_request = new_request_builder(HttpMethod::GET, path, :api_v1)
|
|
21
|
+
.auth(CoreLibrary::Single.new(SINGLE_AUTH_PARTICIPANT))
|
|
22
|
+
|
|
23
|
+
default_options.each do |key, value|
|
|
24
|
+
new_request.query_param(new_parameter(value, key:))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
new_api_call_builder
|
|
28
|
+
.request(new_request)
|
|
29
|
+
.response(new_response_handler)
|
|
30
|
+
.execute
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def campuses_coalitions(campus_id, options: {})
|
|
34
|
+
path = "/campuses/#{campus_id}/coalitions"
|
|
35
|
+
default_options = { limit: 50, offset: 0 }.merge(options)
|
|
36
|
+
|
|
37
|
+
new_request = new_request_builder(HttpMethod::GET, path, :api_v1)
|
|
38
|
+
.auth(CoreLibrary::Single.new(SINGLE_AUTH_PARTICIPANT))
|
|
39
|
+
|
|
40
|
+
default_options.each do |key, value|
|
|
41
|
+
new_request.query_param(new_parameter(value, key:))
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
new_api_call_builder
|
|
45
|
+
.request(new_request)
|
|
46
|
+
.response(new_response_handler)
|
|
47
|
+
.execute
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def campuses_clusters(campus_id, options: {})
|
|
51
|
+
path = "/campuses/#{campus_id}/clusters"
|
|
52
|
+
default_options = { limit: 50, offset: 0 }.merge(options)
|
|
53
|
+
|
|
54
|
+
new_request = new_request_builder(HttpMethod::GET, path, :api_v1)
|
|
55
|
+
.auth(CoreLibrary::Single.new(SINGLE_AUTH_PARTICIPANT))
|
|
56
|
+
|
|
57
|
+
default_options.each do |key, value|
|
|
58
|
+
new_request.query_param(new_parameter(value, key:))
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
new_api_call_builder
|
|
62
|
+
.request(new_request)
|
|
63
|
+
.response(new_response_handler)
|
|
64
|
+
.execute
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module School21
|
|
4
|
+
class ClustersApi < BaseApi
|
|
5
|
+
def clusters_map(cluster_id, options: {})
|
|
6
|
+
path = "/clusters/#{cluster_id}/map"
|
|
7
|
+
default_options = { limit: 50, offset: 0, occupied: true }.merge(options)
|
|
8
|
+
|
|
9
|
+
new_request = new_request_builder(HttpMethod::GET, path, :api_v1)
|
|
10
|
+
.auth(CoreLibrary::Single.new(SINGLE_AUTH_PARTICIPANT))
|
|
11
|
+
|
|
12
|
+
default_options.each do |key, value|
|
|
13
|
+
new_request.query_param(new_parameter(value, key:))
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
new_api_call_builder
|
|
17
|
+
.request(new_request)
|
|
18
|
+
.response(new_response_handler)
|
|
19
|
+
.execute
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -15,17 +15,13 @@ module School21
|
|
|
15
15
|
|
|
16
16
|
def participants_projects(login, options: {})
|
|
17
17
|
path = "/participants/#{login}/projects"
|
|
18
|
-
default_options = { limit:
|
|
19
|
-
|
|
20
|
-
parameters = default_options.map do |key, value|
|
|
21
|
-
new_parameter(value, key:)
|
|
22
|
-
end
|
|
18
|
+
default_options = { limit: 10, offset: 0 }.merge(options)
|
|
23
19
|
|
|
24
20
|
new_request = new_request_builder(HttpMethod::GET, path, :api_v1)
|
|
25
21
|
.auth(CoreLibrary::Single.new(SINGLE_AUTH_PARTICIPANT))
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
new_request.query_param(
|
|
23
|
+
default_options.each do |key, value|
|
|
24
|
+
new_request.query_param(new_parameter(value, key:))
|
|
29
25
|
end
|
|
30
26
|
|
|
31
27
|
new_api_call_builder
|
|
@@ -15,17 +15,13 @@ module School21
|
|
|
15
15
|
|
|
16
16
|
def projects_participants(project_id, options: {})
|
|
17
17
|
path = "/projects/#{project_id}/participants"
|
|
18
|
-
default_options = { limit:
|
|
19
|
-
|
|
20
|
-
parameters = default_options.map do |key, value|
|
|
21
|
-
new_parameter(value, key:)
|
|
22
|
-
end
|
|
18
|
+
default_options = { limit: 10, offset: 0 }.merge(options)
|
|
23
19
|
|
|
24
20
|
new_request = new_request_builder(HttpMethod::GET, path, :api_v1)
|
|
25
21
|
.auth(CoreLibrary::Single.new(SINGLE_AUTH_PARTICIPANT))
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
new_request.query_param(
|
|
23
|
+
default_options.each do |key, value|
|
|
24
|
+
new_request.query_param(new_parameter(value, key:))
|
|
29
25
|
end
|
|
30
26
|
|
|
31
27
|
new_api_call_builder
|
data/lib/school21/client.rb
CHANGED
|
@@ -28,20 +28,30 @@ module School21
|
|
|
28
28
|
initialize_auth!
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
-
def auth_api
|
|
31
|
+
def auth_api
|
|
32
|
+
@auth_api ||= AuthApi.new(@config)
|
|
33
|
+
end
|
|
32
34
|
|
|
33
35
|
def participants_api
|
|
34
36
|
initialize_auth! if @access_token.expired?
|
|
35
|
-
|
|
36
37
|
ParticipantsApi.new(@config)
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
def projects_api
|
|
40
41
|
initialize_auth! if @access_token.expired?
|
|
41
|
-
|
|
42
42
|
ProjectsApi.new(@config)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
def campuses_api
|
|
46
|
+
initialize_auth! if @access_token.expired?
|
|
47
|
+
CampusesApi.new(@config)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def clusters_api
|
|
51
|
+
initialize_auth! if @access_token.expired?
|
|
52
|
+
ClustersApi.new(@config)
|
|
53
|
+
end
|
|
54
|
+
|
|
45
55
|
private
|
|
46
56
|
|
|
47
57
|
def validate_credentials!
|
data/lib/school21/version.rb
CHANGED
data/lib/school21.rb
CHANGED
|
@@ -13,6 +13,8 @@ require_relative 'school21/api/base_api'
|
|
|
13
13
|
require_relative 'school21/api/participants_api'
|
|
14
14
|
require_relative 'school21/api/auth_api'
|
|
15
15
|
require_relative 'school21/api/projects_api'
|
|
16
|
+
require_relative 'school21/api/campuses_api'
|
|
17
|
+
require_relative 'school21/api/clusters_api'
|
|
16
18
|
|
|
17
19
|
require_relative 'school21/config/api_logging_config'
|
|
18
20
|
require_relative 'school21/config/client_config'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: school21_api_sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anton Yudin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-08-
|
|
11
|
+
date: 2024-08-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -94,6 +94,8 @@ files:
|
|
|
94
94
|
- lib/school21.rb
|
|
95
95
|
- lib/school21/api/auth_api.rb
|
|
96
96
|
- lib/school21/api/base_api.rb
|
|
97
|
+
- lib/school21/api/campuses_api.rb
|
|
98
|
+
- lib/school21/api/clusters_api.rb
|
|
97
99
|
- lib/school21/api/participants_api.rb
|
|
98
100
|
- lib/school21/api/projects_api.rb
|
|
99
101
|
- lib/school21/auth/access_token.rb
|
|
@@ -128,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
128
130
|
- !ruby/object:Gem::Version
|
|
129
131
|
version: '0'
|
|
130
132
|
requirements: []
|
|
131
|
-
rubygems_version: 3.5.
|
|
133
|
+
rubygems_version: 3.5.17
|
|
132
134
|
signing_key:
|
|
133
135
|
specification_version: 4
|
|
134
136
|
summary: School21 API SDK
|