Class: WhenIWork::Api
- Inherits:
-
Object
- Object
- WhenIWork::Api
- Defined in:
- lib/wheniwork-ruby/api/api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_positions(opts = {}) ⇒ InlineResponse200
This method allows you to get a list of all positions in your account.
-
#get_positions_with_http_info(opts = {}) ⇒ Array<(InlineResponse200, Fixnum, Hash)>
This method allows you to get a list of all positions in your account.
-
#get_shift(shift_id, opts = {}) ⇒ InlineResponse2002
Gets the details of an existing shift.
-
#get_shift_with_http_info(shift_id, opts = {}) ⇒ Array<(InlineResponse2002, Fixnum, Hash)>
Gets the details of an existing shift.
-
#get_shifts(opts = {}) ⇒ InlineResponse2001
Get a list of shifts.
-
#get_shifts_with_http_info(opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>
Get a list of shifts.
-
#get_user(user_id, opts = {}) ⇒ InlineResponse2003
Get a specific user by their ID.
-
#get_user_with_http_info(user_id, opts = {}) ⇒ Array<(InlineResponse2003, Fixnum, Hash)>
Get a specific user by their ID.
-
#get_users(opts = {}) ⇒ InlineResponse2003
Get a list of users.
-
#get_users_with_http_info(opts = {}) ⇒ Array<(InlineResponse2003, Fixnum, Hash)>
Get a list of users.
-
#initialize(api_client = ApiClient.default) ⇒ Api
constructor
A new instance of Api.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
26 27 28 |
# File 'lib/wheniwork-ruby/api/api.rb', line 26 def api_client @api_client end |
Instance Method Details
#get_positions(opts = {}) ⇒ InlineResponse200
This method allows you to get a list of all positions in your account.
37 38 39 40 |
# File 'lib/wheniwork-ruby/api/api.rb', line 37 def get_positions(opts = {}) data, _status_code, _headers = get_positions_with_http_info(opts) return data end |
#get_positions_with_http_info(opts = {}) ⇒ Array<(InlineResponse200, Fixnum, Hash)>
This method allows you to get a list of all positions in your account.
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 |
# File 'lib/wheniwork-ruby/api/api.rb', line 47 def get_positions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: Api.get_positions ..." end # resource path local_var_path = "/positions".sub('{format}','json') # query parameters query_params = {} query_params[:'show_deleted'] = opts[:'show_deleted'] if opts[:'show_deleted'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apiKey'] 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 => 'InlineResponse200') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#get_positions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_shift(shift_id, opts = {}) ⇒ InlineResponse2002
Gets the details of an existing shift.
93 94 95 96 |
# File 'lib/wheniwork-ruby/api/api.rb', line 93 def get_shift(shift_id, opts = {}) data, _status_code, _headers = get_shift_with_http_info(shift_id, opts) return data end |
#get_shift_with_http_info(shift_id, opts = {}) ⇒ Array<(InlineResponse2002, Fixnum, Hash)>
Gets the details of an existing shift.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/wheniwork-ruby/api/api.rb', line 103 def get_shift_with_http_info(shift_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: Api.get_shift ..." end # verify the required parameter 'shift_id' is set fail ArgumentError, "Missing the required parameter 'shift_id' when calling Api.get_shift" if shift_id.nil? # resource path local_var_path = "/shifts/{shift-id}".sub('{format}','json').sub('{' + 'shift-id' + '}', shift_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apiKey'] 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 => 'InlineResponse2002') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#get_shift\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_shifts(opts = {}) ⇒ InlineResponse2001
Get a list of shifts.
157 158 159 160 |
# File 'lib/wheniwork-ruby/api/api.rb', line 157 def get_shifts(opts = {}) data, _status_code, _headers = get_shifts_with_http_info(opts) return data end |
#get_shifts_with_http_info(opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>
Get a list of shifts.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/wheniwork-ruby/api/api.rb', line 174 def get_shifts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: Api.get_shifts ..." end # resource path local_var_path = "/shifts".sub('{format}','json') # query parameters query_params = {} query_params[:'user_id'] = opts[:'user_id'] if opts[:'user_id'] query_params[:'start'] = opts[:'start_date'] if opts[:'start_date'] query_params[:'end'] = opts[:'end_date'] if opts[:'end_date'] query_params[:'location_id'] = opts[:'location_id'] if opts[:'location_id'] query_params[:'position_id'] = opts[:'position_id'] if opts[:'position_id'] query_params[:'include_open'] = opts[:'include_open'] if opts[:'include_open'] query_params[:'include_onlyopen'] = opts[:'include_onlyopen'] if opts[:'include_onlyopen'] query_params[:'unpublished'] = opts[:'unpublished'] if opts[:'unpublished'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apiKey'] 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 => 'InlineResponse2001') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#get_shifts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_user(user_id, opts = {}) ⇒ InlineResponse2003
Get a specific user by their ID.
227 228 229 230 |
# File 'lib/wheniwork-ruby/api/api.rb', line 227 def get_user(user_id, opts = {}) data, _status_code, _headers = get_user_with_http_info(user_id, opts) return data end |
#get_user_with_http_info(user_id, opts = {}) ⇒ Array<(InlineResponse2003, Fixnum, Hash)>
Get a specific user by their ID.
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/wheniwork-ruby/api/api.rb', line 237 def get_user_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: Api.get_user ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling Api.get_user" if user_id.nil? # resource path local_var_path = "/users/{user-id}".sub('{format}','json').sub('{' + 'user-id' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apiKey'] 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 => 'InlineResponse2003') if @api_client.config.debugging @api_client.config.logger.debug "API called: Api#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_users(opts = {}) ⇒ InlineResponse2003
Get a list of users.
286 287 288 289 |
# File 'lib/wheniwork-ruby/api/api.rb', line 286 def get_users(opts = {}) data, status_code, headers = get_users_with_http_info(opts) return data end |
#get_users_with_http_info(opts = {}) ⇒ Array<(InlineResponse2003, Fixnum, Hash)>
Get a list of users.
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/wheniwork-ruby/api/api.rb', line 298 def get_users_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DefaultApi#get_users ..." end # resource path local_var_path = "/users".sub('{format}','json') # query parameters query_params = {} query_params[:'ids'] = opts[:'ids'] if opts[:'ids'] query_params[:'location_id'] = opts[:'location_id'] if opts[:'location_id'] query_params[:'show_deleted'] = opts[:'show_deleted'] if opts[:'show_deleted'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apiKey'] 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 => 'InlineResponse2003') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |