Class: School21::CampusesApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/school21/api/campuses_api.rb

Constant Summary

Constants inherited from BaseApi

BaseApi::SINGLE_AUTH_PARTICIPANT

Instance Method Summary collapse

Methods inherited from BaseApi

#authenticated_request, base_uri, #execute_request, #initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, response_convertor

Constructor Details

This class inherits a constructor from School21::BaseApi

Instance Method Details

#campus_clusters(campus_id, options: {}) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/school21/api/campuses_api.rb', line 36

def campus_clusters(campus_id, options: {})
  path = "/campuses/#{campus_id}/clusters"
  default_options = { limit: 50, offset: 0 }.merge(options)
  new_request = authenticated_request(HttpMethod::GET, path, :api_v1)

  default_options.each do |key, value|
    new_request.query_param(new_parameter(value, key:))
  end

  execute_request(new_request)
end

#campus_coalitions(campus_id, options: {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/school21/api/campuses_api.rb', line 24

def campus_coalitions(campus_id, options: {})
  path = "/campuses/#{campus_id}/coalitions"
  default_options = { limit: 50, offset: 0 }.merge(options)
  new_request = authenticated_request(HttpMethod::GET, path, :api_v1)

  default_options.each do |key, value|
    new_request.query_param(new_parameter(value, key:))
  end

  execute_request(new_request)
end

#campus_participants(campus_id, options: {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/school21/api/campuses_api.rb', line 12

def campus_participants(campus_id, options: {})
  path = "/campuses/#{campus_id}/participants"
  default_options = { limit: 50, offset: 0 }.merge(options)
  new_request = authenticated_request(HttpMethod::GET, path, :api_v1)

  default_options.each do |key, value|
    new_request.query_param(new_parameter(value, key:))
  end

  execute_request(new_request)
end

#campusesObject



5
6
7
8
9
10
# File 'lib/school21/api/campuses_api.rb', line 5

def campuses
  path = '/campuses'
  new_request = authenticated_request(HttpMethod::GET, path, :api_v1)

  execute_request(new_request)
end