class SwaggerClient::EnrollmentApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/swagger_client/api/enrollment_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

enrollment_add_client_to_enrollment(request, site_id, version, opts = {}) click to toggle source

Book a client into an enrollment. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @return [ClassSchedule]

# 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 = {}) click to toggle source

Book a client into an enrollment. @param request @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @return [Array<(ClassSchedule, Fixnum, Hash)>] ClassSchedule data, response status code and response headers

# 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 = {}) click to toggle source

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. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. (default to ) @option opts [Array<Integer>] :request_class_schedule_ids A list of the requested class schedule IDs. If omitted, all class schedule IDs return. @option opts [DateTime] :request_end_date The end of the date range. The response returns any active enrollments that occur on or before this day.&lt;br /&gt; Default: StartDate @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Array<Integer>] :request_location_ids List of the IDs for the requested locations. If omitted, all location IDs return. @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [Array<Integer>] :request_program_ids List of the IDs for the requested programs. If omitted, all program IDs return. @option opts [Array<Integer>] :request_session_type_ids List of the IDs for the requested session types. If omitted, all session types IDs return. @option opts [Array<Integer>] :request_staff_ids List of the IDs for the requested staff IDs. If omitted, all staff IDs return. @option opts [DateTime] :request_start_date 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** @return [GetEnrollmentsResponse]

# 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 = {}) click to toggle source

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. @param site_id ID of the site from which to pull data. @param version @param [Hash] opts the optional parameters @option opts [String] :authorization A staff user authorization token. @option opts [Array<Integer>] :request_class_schedule_ids A list of the requested class schedule IDs. If omitted, all class schedule IDs return. @option opts [DateTime] :request_end_date The end of the date range. The response returns any active enrollments that occur on or before this day.&lt;br /&gt; Default: StartDate @option opts [Integer] :request_limit Number of results to include, defaults to 100 @option opts [Array<Integer>] :request_location_ids List of the IDs for the requested locations. If omitted, all location IDs return. @option opts [Integer] :request_offset Page offset, defaults to 0. @option opts [Array<Integer>] :request_program_ids List of the IDs for the requested programs. If omitted, all program IDs return. @option opts [Array<Integer>] :request_session_type_ids List of the IDs for the requested session types. If omitted, all session types IDs return. @option opts [Array<Integer>] :request_staff_ids List of the IDs for the requested staff IDs. If omitted, all staff IDs return. @option opts [DateTime] :request_start_date 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** @return [Array<(GetEnrollmentsResponse, Fixnum, Hash)>] GetEnrollmentsResponse data, response status code and response headers

# 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