Class: BombBomb::CurriculumApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bombbomb/api/curriculum_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CurriculumApi

Returns a new instance of CurriculumApi.



19
20
21
# File 'lib/bombbomb/api/curriculum_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/bombbomb/api/curriculum_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_curricula(opts = {}) ⇒ Array<Curriculum>

Get Curricula Get Curricula, optionally with progress included.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_progress (BOOLEAN)

    Whether to return progress with the curriculum.

Returns:



28
29
30
31
# File 'lib/bombbomb/api/curriculum_api.rb', line 28

def get_curricula(opts = {})
  data, _status_code, _headers = get_curricula_with_http_info(opts)
  return data
end

#get_curricula_with_http_info(opts = {}) ⇒ Array<(Array<Curriculum>, Fixnum, Hash)>

Get Curricula Get Curricula, optionally with progress included.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :include_progress (BOOLEAN)

    Whether to return progress with the curriculum.

Returns:

  • (Array<(Array<Curriculum>, Fixnum, Hash)>)

    Array<Curriculum> data, response status code and response headers



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/bombbomb/api/curriculum_api.rb', line 38

def get_curricula_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CurriculumApi.get_curricula ..."
  end
  # resource path
  local_var_path = "/curricula/"

  # query parameters
  query_params = {}
  query_params[:'includeProgress'] = opts[:'include_progress'] if !opts[:'include_progress'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Curriculum>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurriculumApi#get_curricula\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_curriculum_with_progress(opts = {}) ⇒ Array<CurriculumWithProgress>

Get Detailed For User Get all curricula for user including progress for each curriculum.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



79
80
81
82
# File 'lib/bombbomb/api/curriculum_api.rb', line 79

def get_user_curriculum_with_progress(opts = {})
  data, _status_code, _headers = get_user_curriculum_with_progress_with_http_info(opts)
  return data
end

#get_user_curriculum_with_progress_with_http_info(opts = {}) ⇒ Array<(Array<CurriculumWithProgress>, Fixnum, Hash)>

Get Detailed For User Get all curricula for user including progress for each curriculum.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<CurriculumWithProgress>, Fixnum, Hash)>)

    Array<CurriculumWithProgress> data, response status code and response headers



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/bombbomb/api/curriculum_api.rb', line 88

def get_user_curriculum_with_progress_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: CurriculumApi.get_user_curriculum_with_progress ..."
  end
  # resource path
  local_var_path = "/curriculum/getForUserWithProgress"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['BBOAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<CurriculumWithProgress>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurriculumApi#get_user_curriculum_with_progress\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end