Class: SwaggerClient::PayrollApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PayrollApi

Returns a new instance of PayrollApi.



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

def api_client
  @api_client
end

Instance Method Details

#payroll_get_class_payroll(site_id, version, opts = {}) ⇒ GetClassPayrollResponse

Get class payroll for staff members. A staff authorization token is not required for this endpoint, but if one is passed, its permissions are honored. Depending on the access permissions configured for the staff member whose token is passed, the endpoint returns either only the payroll information for that staff member or it returns the payroll information for all staff members. Note that if a staff member is not paid for a class, earnings of zero are returned by this endpoint. Note that this endpoint calculates both bonus and no-reg rates for assistants.These rates are not supported by the Payroll report in the web interface. Note that this endpoint returns both the teacher’s adjusted rate and the assistant’s pay rate when the assistant is paid by the teacher.The Payroll report in the web interface only returns the teacher’s adjusted rate.

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_end_date_time (DateTime)

    The end of the date range for the payroll information to be returned. The maximum allowed date range is 14 days.<br /> Default: **Today’s date** * If you do not supply an `EndDateTime`, the data returns for the period from the `StartDateTime` that you supply to today’s date. * If you do not supply an `EndDateTime` or a `StartDateTime`, data returns for the seven days prior to today’s date.

  • :request_include_inactive_staff (BOOLEAN)

    When `true`, payroll information returns for both active and inactive staff members.<br /> Default: false

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_staff_id (Integer)

    A list of staff IDs that you want to retrieve payroll information for. If you do not supply a `StaffId`, all active staff members return, ordered by staff ID.

  • :request_start_date_time (DateTime)

    The beginning of the date range for the payroll information to be returned. The maximum allowed date range is 14 days. * If you do not supply a `StartDateTime`, data returns for the seven days prior to the `EndDateTime` that you supply. * If you do not supply either a `StartDateTime` or an `EndDateTime`, the data returns for seven days prior to today’s date.

Returns:



35
36
37
38
# File 'lib/swagger_client/api/payroll_api.rb', line 35

def payroll_get_class_payroll(site_id, version, opts = {})
  data, _status_code, _headers = payroll_get_class_payroll_with_http_info(site_id, version, opts)
  data
end

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

Get class payroll for staff members. A staff authorization token is not required for this endpoint, but if one is passed, its permissions are honored. Depending on the access permissions configured for the staff member whose token is passed, the endpoint returns either only the payroll information for that staff member or it returns the payroll information for all staff members. Note that if a staff member is not paid for a class, earnings of zero are returned by this endpoint. Note that this endpoint calculates both bonus and no-reg rates for assistants.These rates are not supported by the Payroll report in the web interface. Note that this endpoint returns both the teacher’s adjusted rate and the assistant’s pay rate when the assistant is paid by the teacher.The Payroll report in the web interface only returns the teacher’s adjusted rate.

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_end_date_time (DateTime)

    The end of the date range for the payroll information to be returned. The maximum allowed date range is 14 days.&lt;br /&gt; Default: **Today’s date** * If you do not supply an &#x60;EndDateTime&#x60;, the data returns for the period from the &#x60;StartDateTime&#x60; that you supply to today’s date. * If you do not supply an &#x60;EndDateTime&#x60; or a &#x60;StartDateTime&#x60;, data returns for the seven days prior to today’s date.

  • :request_include_inactive_staff (BOOLEAN)

    When &#x60;true&#x60;, payroll information returns for both active and inactive staff members.&lt;br /&gt; Default: false

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_staff_id (Integer)

    A list of staff IDs that you want to retrieve payroll information for. If you do not supply a &#x60;StaffId&#x60;, all active staff members return, ordered by staff ID.

  • :request_start_date_time (DateTime)

    The beginning of the date range for the payroll information to be returned. The maximum allowed date range is 14 days. * If you do not supply a &#x60;StartDateTime&#x60;, data returns for the seven days prior to the &#x60;EndDateTime&#x60; that you supply. * If you do not supply either a &#x60;StartDateTime&#x60; or an &#x60;EndDateTime&#x60;, the data returns for seven days prior to today’s date.

Returns:

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

    GetClassPayrollResponse data, response status code and response headers



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
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/swagger_client/api/payroll_api.rb', line 53

def payroll_get_class_payroll_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayrollApi.payroll_get_class_payroll ...'
  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 PayrollApi.payroll_get_class_payroll"
  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 PayrollApi.payroll_get_class_payroll"
  end
  # resource path
  local_var_path = '/public/v{version}/payroll/classes'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.endDateTime'] = opts[:'request_end_date_time'] if !opts[:'request_end_date_time'].nil?
  query_params[:'request.includeInactiveStaff'] = opts[:'request_include_inactive_staff'] if !opts[:'request_include_inactive_staff'].nil?
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?
  query_params[:'request.staffId'] = opts[:'request_staff_id'] if !opts[:'request_staff_id'].nil?
  query_params[:'request.startDateTime'] = opts[:'request_start_date_time'] if !opts[:'request_start_date_time'].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 => 'GetClassPayrollResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayrollApi#payroll_get_class_payroll\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#payroll_get_time_clock(site_id, version, opts = {}) ⇒ GetTimeClockResponse

Get time card payroll for staff members.

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_end_date_time (DateTime)

    The end of the date range for the time card information to be returned. If you do not supply an &#x60;EndDateTime&#x60;, data returns for the seven days prior to today’s date. Classes that begin before the &#x60;EndDateTime&#x60; are included in the response, regardless of the time that the class ends. The maximum allowed date range is 14 days.&lt;br /&gt; Default: **Today’s date**

  • :request_include_inactive_staff (BOOLEAN)

    When &#x60;true&#x60;, payroll information returns for both active and inactive staff members.&lt;br /&gt; Default: false

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_staff_id (Integer)

    The staff ID for whom you want to retrieve time card information. If you do not supply a &#x60;StaffId&#x60;, all active staff members return, ordered by staff ID.

  • :request_start_date_time (DateTime)

    The beginning of the date range for the time card information to be returned. If you do not supply a &#x60;StartDateTime&#x60;, data returns for the seven days prior to the &#x60;EndDateTime&#x60; that you supply. The maximum allowed date range is 14 days.

Returns:



114
115
116
117
# File 'lib/swagger_client/api/payroll_api.rb', line 114

def payroll_get_time_clock(site_id, version, opts = {})
  data, _status_code, _headers = payroll_get_time_clock_with_http_info(site_id, version, opts)
  data
end

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

Get time card payroll for staff members.

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_end_date_time (DateTime)

    The end of the date range for the time card information to be returned. If you do not supply an &#x60;EndDateTime&#x60;, data returns for the seven days prior to today’s date. Classes that begin before the &#x60;EndDateTime&#x60; are included in the response, regardless of the time that the class ends. The maximum allowed date range is 14 days.&lt;br /&gt; Default: **Today’s date**

  • :request_include_inactive_staff (BOOLEAN)

    When &#x60;true&#x60;, payroll information returns for both active and inactive staff members.&lt;br /&gt; Default: false

  • :request_limit (Integer)

    Number of results to include, defaults to 100

  • :request_offset (Integer)

    Page offset, defaults to 0.

  • :request_staff_id (Integer)

    The staff ID for whom you want to retrieve time card information. If you do not supply a &#x60;StaffId&#x60;, all active staff members return, ordered by staff ID.

  • :request_start_date_time (DateTime)

    The beginning of the date range for the time card information to be returned. If you do not supply a &#x60;StartDateTime&#x60;, data returns for the seven days prior to the &#x60;EndDateTime&#x60; that you supply. The maximum allowed date range is 14 days.

Returns:

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

    GetTimeClockResponse data, response status code and response headers



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
179
# File 'lib/swagger_client/api/payroll_api.rb', line 131

def payroll_get_time_clock_with_http_info(site_id, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayrollApi.payroll_get_time_clock ...'
  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 PayrollApi.payroll_get_time_clock"
  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 PayrollApi.payroll_get_time_clock"
  end
  # resource path
  local_var_path = '/public/v{version}/payroll/timeclock'.sub('{' + 'version' + '}', version.to_s)

  # query parameters
  query_params = {}
  query_params[:'request.endDateTime'] = opts[:'request_end_date_time'] if !opts[:'request_end_date_time'].nil?
  query_params[:'request.includeInactiveStaff'] = opts[:'request_include_inactive_staff'] if !opts[:'request_include_inactive_staff'].nil?
  query_params[:'request.limit'] = opts[:'request_limit'] if !opts[:'request_limit'].nil?
  query_params[:'request.offset'] = opts[:'request_offset'] if !opts[:'request_offset'].nil?
  query_params[:'request.staffId'] = opts[:'request_staff_id'] if !opts[:'request_staff_id'].nil?
  query_params[:'request.startDateTime'] = opts[:'request_start_date_time'] if !opts[:'request_start_date_time'].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 => 'GetTimeClockResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayrollApi#payroll_get_time_clock\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end