Skip to content

Commit

Permalink
Merge pull request #138 from XeroAPI/fix_rails_dependencies
Browse files Browse the repository at this point in the history
Fix rails dependencies
  • Loading branch information
SerKnight authored Feb 26, 2021
2 parents 75947b1 + db234b7 commit 255fa12
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/xero-ruby/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
require 'tempfile'
require 'find'
require 'faraday'
require 'base64'

module XeroRuby
class ApiClient
Expand Down Expand Up @@ -136,7 +137,7 @@ def token_request(data, path)
req.body = URI.encode_www_form(data)
end
return_error(response) unless response.success?
if !response.body.blank?
if !response.body.nil? && !response.body.empty?
body = JSON.parse(response.body)
set_token_set(body)
else
Expand Down
11 changes: 9 additions & 2 deletions lib/xero-ruby/models/payroll_uk/earnings_rate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ class EarningsRate
OVERTIME_EARNINGS = "OvertimeEarnings".freeze
REGULAR_EARNINGS = "RegularEarnings".freeze
STATUTORY_ADOPTION_PAY = "StatutoryAdoptionPay".freeze
STATUTORY_ADOPTION_PAY_NON_PENSIONABLE = "StatutoryAdoptionPayNonPensionable".freeze
STATUTORY_BEREAVEMENT_PAY = "StatutoryBereavementPay".freeze
STATUTORY_MATERNITY_PAY = "StatutoryMaternityPay".freeze
STATUTORY_MATERNITY_PAY_NON_PENSIONABLE = "StatutoryMaternityPayNonPensionable".freeze
STATUTORY_PATERNITY_PAY = "StatutoryPaternityPay".freeze
STATUTORY_PATERNITY_PAY_NON_PENSIONABLE = "StatutoryPaternityPayNonPensionable".freeze
STATUTORY_PARENTAL_BEREAVEMENT_PAY_NON_PENSIONABLE = "StatutoryParentalBereavementPayNonPensionable".freeze
STATUTORY_SHARED_PARENTAL_PAY = "StatutorySharedParentalPay".freeze
STATUTORY_SHARED_PARENTAL_PAY_NON_PENSIONABLE = "StatutorySharedParentalPayNonPensionable".freeze
STATUTORY_SICK_PAY = "StatutorySickPay".freeze
STATUTORY_SICK_PAY_NON_PENSIONABLE = "StatutorySickPayNonPensionable".freeze
TIPS_DIRECT = "Tips(Direct)".freeze
TIPS_NON_DIRECT = "Tips(Non-Direct)".freeze

Expand Down Expand Up @@ -206,7 +213,7 @@ def list_invalid_properties
def valid?
return false if @name.nil?
return false if @earnings_type.nil?
earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryMaternityPay", "StatutoryPaternityPay", "StatutorySharedParentalPay", "StatutorySickPay", "Tips(Direct)", "Tips(Non-Direct)"])
earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "Tips(Direct)", "Tips(Non-Direct)"])
return false unless earnings_type_validator.valid?(@earnings_type)
return false if @rate_type.nil?
rate_type_validator = EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"])
Expand All @@ -219,7 +226,7 @@ def valid?
# Custom attribute writer method checking allowed values (enum).
# @param [Object] earnings_type Object to be assigned
def earnings_type=(earnings_type)
validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryMaternityPay", "StatutoryPaternityPay", "StatutorySharedParentalPay", "StatutorySickPay", "Tips(Direct)", "Tips(Non-Direct)"])
validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "Tips(Direct)", "Tips(Non-Direct)"])
unless validator.valid?(earnings_type)
fail ArgumentError, "invalid value for \"earnings_type\", must be one of #{validator.allowable_values}."
end
Expand Down
4 changes: 2 additions & 2 deletions lib/xero-ruby/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
The version of the XeroOpenAPI document: 2.9.3
The version of the XeroOpenAPI document: 2.9.4
=end

module XeroRuby
VERSION = '2.7.0'
VERSION = '2.7.1'
end

0 comments on commit 255fa12

Please sign in to comment.