Class: SwaggerClient::EnrollmentApi

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_client/api/enrollment_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EnrollmentApi

Returns a new instance of EnrollmentApi.



19
20
21
# File 'lib/swagger_client/api/enrollment_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/swagger_client/api/enrollment_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#enrollment_add_client_to_enrollment(request, site_id, version, opts = {}) ⇒ ClassSchedule

Book a client into an enrollment.

Parameters:

  • request
  • site_id

    ID of the site from which to pull data.

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

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

Returns:



29
30
31
32
# File 'lib/swagger_client/api/enrollment_api.rb', line 29

def enrollment_add_client_to_enrollment(request, site_id, version, opts = {})
  data, _status_code, _headers = enrollment_add_client_to_enrollment_with_http_info(request, site_id, version, opts)
  data
end

#enrollment_add_client_to_enrollment_with_http_info(request, site_id, version, opts = {}) ⇒ Array<(ClassSchedule, Fixnum, Hash)>

Book a client into an enrollment.

Parameters:

  • request
  • site_id

    ID of the site from which to pull data.

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

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

Returns:

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

    ClassSchedule data, response status code and response headers



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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/swagger_client/api/enrollment_api.rb', line 41

def enrollment_add_client_to_enrollment_with_http_info(request, site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EnrollmentApi.enrollment_add_client_to_enrollment ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling EnrollmentApi.enrollment_add_client_to_enrollment"
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling EnrollmentApi.enrollment_add_client_to_enrollment"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling EnrollmentApi.enrollment_add_client_to_enrollment"
  end
  # resource path
  local_var_path = '/public/v{version}/enrollment/addclienttoenrollment'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ClassSchedule')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EnrollmentApi#enrollment_add_client_to_enrollment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enrollment_get_enrollments(site_id, version, opts = {}) ⇒ GetEnrollmentsResponse

Get enrollments scheduled at a site. Returns a list of enrollments. An enrollment is a service, such as a workshop or an event, that a staff member offers to multiple students, who commit to coming to all or most of the scheduled sessions. Enrollments typically run for a limited time only.

Parameters:

  • site_id

    ID of the site from which to pull data.

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

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token. (default to )

  • :request_class_schedule_ids (Array<Integer>)

    A list of the requested class schedule IDs. If omitted, all class schedule IDs return.

  • :request_end_date (DateTime)

    The end of the date range. The response returns any active enrollments that occur on or before this day.&lt;br /&gt; Default: StartDate

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_ids (Array<Integer>)

    List of the IDs for the requested locations. If omitted, all location IDs return.

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_program_ids (Array<Integer>)

    List of the IDs for the requested programs. If omitted, all program IDs return.

  • :request_session_type_ids (Array<Integer>)

    List of the IDs for the requested session types. If omitted, all session types IDs return.

  • :request_staff_ids (Array<Integer>)

    List of the IDs for the requested staff IDs. If omitted, all staff IDs return.

  • :request_start_date (DateTime)

    The start of the date range. The response returns any active enrollments that occur on or after this day.&lt;br /&gt; Default: **today’s date**

Returns:



106
107
108
109
# File 'lib/swagger_client/api/enrollment_api.rb', line 106

def enrollment_get_enrollments(site_id, version, opts = {})
  data, _status_code, _headers = enrollment_get_enrollments_with_http_info(site_id, version, opts)
  data
end

#enrollment_get_enrollments_with_http_info(site_id, version, opts = {}) ⇒ Array<(GetEnrollmentsResponse, Fixnum, Hash)>

Get enrollments scheduled at a site. Returns a list of enrollments. An enrollment is a service, such as a workshop or an event, that a staff member offers to multiple students, who commit to coming to all or most of the scheduled sessions. Enrollments typically run for a limited time only.

Parameters:

  • site_id

    ID of the site from which to pull data.

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

    the optional parameters

Options Hash (opts):

  • :authorization (String)

    A staff user authorization token.

  • :request_class_schedule_ids (Array<Integer>)

    A list of the requested class schedule IDs. If omitted, all class schedule IDs return.

  • :request_end_date (DateTime)

    The end of the date range. The response returns any active enrollments that occur on or before this day.&lt;br /&gt; Default: StartDate

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_location_ids (Array<Integer>)

    List of the IDs for the requested locations. If omitted, all location IDs return.

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_program_ids (Array<Integer>)

    List of the IDs for the requested programs. If omitted, all program IDs return.

  • :request_session_type_ids (Array<Integer>)

    List of the IDs for the requested session types. If omitted, all session types IDs return.

  • :request_staff_ids (Array<Integer>)

    List of the IDs for the requested staff IDs. If omitted, all staff IDs return.

  • :request_start_date (DateTime)

    The start of the date range. The response returns any active enrollments that occur on or after this day.&lt;br /&gt; Default: **today’s date**

Returns:

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

    GetEnrollmentsResponse data, response status code and response headers



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/swagger_client/api/enrollment_api.rb', line 127

def enrollment_get_enrollments_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EnrollmentApi.enrollment_get_enrollments ...'
  end
  # verify the required parameter 'site_id' is set
  if @api_client.config.client_side_validation && site_id.nil?
    fail ArgumentError, "Missing the required parameter 'site_id' when calling EnrollmentApi.enrollment_get_enrollments"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling EnrollmentApi.enrollment_get_enrollments"
  end
  # resource path
  local_var_path = '/public/v{version}/enrollment/enrollments'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.classScheduleIds'] = @api_client.build_collection_param(opts[:'request_class_schedule_ids'], :multi) if !opts[:'request_class_schedule_ids'].nil?
  query_params[:'request.endDate'] = opts[:'request_end_date'] if !opts[:'request_end_date'].nil?
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.locationIds'] = @api_client.build_collection_param(opts[:'request_location_ids'], :multi) if !opts[:'request_location_ids'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?
  query_params[:'request.programIds'] = @api_client.build_collection_param(opts[:'request_program_ids'], :multi) if !opts[:'request_program_ids'].nil?
  query_params[:'request.sessionTypeIds'] = @api_client.build_collection_param(opts[:'request_session_type_ids'], :multi) if !opts[:'request_session_type_ids'].nil?
  query_params[:'request.staffIds'] = @api_client.build_collection_param(opts[:'request_staff_ids'], :multi) if !opts[:'request_staff_ids'].nil?
  query_params[:'request.startDate'] = opts[:'request_start_date'] if !opts[:'request_start_date'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'])
  header_params[:'siteId'] = site_id
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  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 => 'GetEnrollmentsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EnrollmentApi#enrollment_get_enrollments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end