Skip to content

Commit

Permalink
Build from OAS 4.0.0 (#280)
Browse files Browse the repository at this point in the history
* Build from OAS 4.0.0

* update rubocop gem

* fix broken links to xero developer guide
  • Loading branch information
manishT72 authored Jun 21, 2024
1 parent c1d8727 commit 39afb5a
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ gemspec
group :development, :test do
gem 'rake', '~> 12.3.3'
gem 'pry-byebug'
gem 'rubocop', '~> 0.66.0'
gem 'rubocop', '~> 0.70'
end
67 changes: 42 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,57 +1,71 @@
PATH
remote: .
specs:
xero-ruby (5.0.0)
xero-ruby (7.0.0)
faraday (>= 2.0, < 3.0)
json (~> 2.1, >= 2.1.0)
json-jwt (~> 1.16, >= 1.16.3)

GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.4)
activesupport (7.1.3.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
aes_key_wrap (1.1.0)
ast (2.4.2)
bindata (2.4.14)
base64 (0.2.0)
bigdecimal (3.1.8)
bindata (2.5.0)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.1.10)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
diff-lcs (1.5.0)
faraday (2.7.1)
drb (2.2.1)
faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-follow_redirects (0.3.0)
faraday (>= 1, < 3)
faraday-net_http (3.0.2)
i18n (1.12.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.4)
json (2.6.3)
json-jwt (1.16.1)
json (2.7.2)
json-jwt (1.16.6)
activesupport (>= 4.2)
aes_key_wrap
base64
bindata
faraday (~> 2.0)
faraday-follow_redirects
method_source (1.0.0)
minitest (5.16.3)
parallel (1.21.0)
parser (3.1.0.0)
minitest (5.24.0)
mutex_m (0.2.0)
parallel (1.25.1)
parser (3.3.3.0)
ast (~> 2.4.1)
racc
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.13.0)
psych (4.0.3)
stringio
racc (1.8.0)
rainbow (3.1.1)
rake (12.3.3)
regexp_parser (2.9.2)
rexml (3.3.0)
strscan
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
Expand All @@ -65,20 +79,23 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.3)
rubocop (0.66.0)
jaro_winkler (~> 1.5.1)
rubocop (0.93.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
psych (>= 3.1.0)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
rexml
rubocop-ast (>= 0.6.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.6)
ruby-progressbar (1.11.0)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
stringio (3.0.1)
tzinfo (2.0.5)
strscan (3.1.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (1.5.0)
unicode-display_width (1.8.0)

PLATFORMS
ruby
Expand All @@ -88,8 +105,8 @@ DEPENDENCIES
pry-byebug
rake (~> 12.3.3)
rspec (~> 3.6, >= 3.6.0)
rubocop (~> 0.66.0)
rubocop (~> 0.70)
xero-ruby!

BUNDLED WITH
2.2.3
2.4.22
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Sample apps can get you started quickly with simple auth flows to advanced usage
| --- | --- | --- |
| [`xero-ruby-oauth2-starter`](https://github.com/XeroAPI/Xero-ruby-oauth2-starter) | A Sinatra application showing the basic getting started code to work with the sdk | <img src="https://i.imgur.com/9H4F98M.png" alt="drawing" width="300"/>
| [`xero-ruby-oauth2-app`](https://github.com/XeroAPI/Xero-ruby-oauth2-app) | Complete rails app with +95% of api set examples, complex filters, pagination, and user/token management in postgres | <img src="https://i.imgur.com/XsAp9Ww.png" alt="drawing" width="500"/>
| [`xero-ruby-custom-connections-starter`](https://github.com/XeroAPI/xero-ruby-custom-connections-starter) | A getting started Sinatra app showing Custom Connections - a Xero [premium option](https://developer.xero.com/documentation/oauth2/custom-connections) for building M2M integrations to a single org | <img src="https://i.imgur.com/YEkScui.png" alt="drawing" width="300"/>
| [`xero-ruby-custom-connections-starter`](https://github.com/XeroAPI/xero-ruby-custom-connections-starter) | A getting started Sinatra app showing Custom Connections - a Xero [premium option](https://developer.xero.com/documentation/guides/oauth2/custom-connections) for building M2M integrations to a single org | <img src="https://i.imgur.com/YEkScui.png" alt="drawing" width="300"/>
| [`xero-ruby-sso-form`](https://github.com/XeroAPI/xero-ruby-sso-form) | A basic Sinatra app showing how to implement SSU to Lead | <img src="https://i.imgur.com/Nf95GVd.png" alt="drawing" width="300"/>

<hr>
Expand Down
4 changes: 2 additions & 2 deletions docs/accounting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4062,7 +4062,7 @@
"Class" : {
"type" : "string",
"description" : "Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM)",
"enum" : [ "DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE" ]
"enum" : [ "DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "IGNITE", "GROW", "COMPREHENSIVE" ]
},
"Edition" : {
"type" : "string",
Expand Down Expand Up @@ -6100,7 +6100,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Accounting"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>6.0.0</li>
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>7.0.0</li>
<li class="nav-header" data-group="Accounting"><a href="#api-Accounting">Methods</a></li>
<li data-group="Accounting" data-name="createAccount" class="">
<a href="#api-Accounting-createAccount">createAccount</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/app_store/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="AppStore"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>6.0.0</li>
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>7.0.0</li>
<li class="nav-header" data-group="AppStore"><a href="#api-AppStore">Methods</a></li>
<li data-group="AppStore" data-name="getSubscription" class="">
<a href="#api-AppStore-getSubscription">getSubscription</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Asset"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>6.0.0</li>
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>7.0.0</li>
<li class="nav-header" data-group="Asset"><a href="#api-Asset">Methods</a></li>
<li data-group="Asset" data-name="createAsset" class="">
<a href="#api-Asset-createAsset">createAsset</a>
Expand Down
8 changes: 7 additions & 1 deletion docs/files/Association.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**send_with_object** | **Boolean** | Boolean flag to determines whether the file is sent with the document it is attached to on client facing communications. Note- The SendWithObject element is only returned when using /Associations/{ObjectId} endpoint. | [optional]
**name** | **String** | The name of the associated file. Note- The Name element is only returned when using /Associations/{ObjectId} endpoint. | [optional]
**size** | **Integer** | The size of the associated file in bytes. Note- The Size element is only returned when using /Associations/{ObjectId} endpoint. | [optional]
**file_id** | **String** | The unique identifier of the file | [optional]
**object_id** | **String** | The identifier of the object that the file is being associated with (e.g. InvoiceID, BankTransactionID, ContactID) | [optional]
**object_group** | [**ObjectGroup**](ObjectGroup.md) | | [optional]
Expand All @@ -14,7 +17,10 @@ Name | Type | Description | Notes
```ruby
require 'XeroRuby::Files'

instance = XeroRuby::Files::Association.new(file_id: null,
instance = XeroRuby::Files::Association.new(send_with_object: true,
name: Test.pdf,
size: 12357,
file_id: null,
object_id: null,
object_group: null,
object_type: null)
Expand Down
17 changes: 16 additions & 1 deletion docs/files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,21 @@
"title" : "",
"type" : "object",
"properties" : {
"SendWithObject" : {
"type" : "boolean",
"description" : "Boolean flag to determines whether the file is sent with the document it is attached to on client facing communications. Note- The SendWithObject element is only returned when using /Associations/{ObjectId} endpoint.",
"example" : true
},
"Name" : {
"type" : "string",
"description" : "The name of the associated file. Note- The Name element is only returned when using /Associations/{ObjectId} endpoint.",
"example" : "Test.pdf"
},
"Size" : {
"type" : "integer",
"description" : "The size of the associated file in bytes. Note- The Size element is only returned when using /Associations/{ObjectId} endpoint.",
"example" : 12357
},
"FileId" : {
"type" : "string",
"description" : "The unique identifier of the file",
Expand Down Expand Up @@ -1155,7 +1170,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Files"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Files"><strong>VSN: </strong>6.0.0</li>
<li class="nav-header" data-group="Files"><strong>VSN: </strong>7.0.0</li>
<li class="nav-header" data-group="Files"><a href="#api-Files">Methods</a></li>
<li data-group="Files" data-name="createFileAssociation" class="">
<a href="#api-Files-createFileAssociation">createFileAssociation</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/finance/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2734,7 +2734,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Finance"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>6.0.0</li>
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>7.0.0</li>
<li class="nav-header" data-group="Finance"><a href="#api-Finance">Methods</a></li>
<li data-group="Finance" data-name="getAccountingActivityAccountUsage" class="">
<a href="#api-Finance-getAccountingActivityAccountUsage">getAccountingActivityAccountUsage</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/payroll_au/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3412,7 +3412,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="PayrollAu"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>6.0.0</li>
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>7.0.0</li>
<li class="nav-header" data-group="PayrollAu"><a href="#api-PayrollAu">Methods</a></li>
<li data-group="PayrollAu" data-name="approveLeaveApplication" class="">
<a href="#api-PayrollAu-approveLeaveApplication">approveLeaveApplication</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/payroll_nz/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3843,7 +3843,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="PayrollNz"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>6.0.0</li>
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>7.0.0</li>
<li class="nav-header" data-group="PayrollNz"><a href="#api-PayrollNz">Methods</a></li>
<li data-group="PayrollNz" data-name="approveTimesheet" class="">
<a href="#api-PayrollNz-approveTimesheet">approveTimesheet</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/payroll_uk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3510,7 +3510,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="PayrollUk"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>6.0.0</li>
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>7.0.0</li>
<li class="nav-header" data-group="PayrollUk"><a href="#api-PayrollUk">Methods</a></li>
<li data-group="PayrollUk" data-name="approveTimesheet" class="">
<a href="#api-PayrollUk-approveTimesheet">approveTimesheet</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/projects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Project"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Project"><strong>VSN: </strong>6.0.0</li>
<li class="nav-header" data-group="Project"><strong>VSN: </strong>7.0.0</li>
<li class="nav-header" data-group="Project"><a href="#api-Project">Methods</a></li>
<li data-group="Project" data-name="createProject" class="">
<a href="#api-Project-createProject">createProject</a>
Expand Down
7 changes: 5 additions & 2 deletions lib/xero-ruby/models/accounting/organisation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ class Organisation
NON_GST_CASHBOOK ||= "NON_GST_CASHBOOK".freeze
ULTIMATE ||= "ULTIMATE".freeze
LITE ||= "LITE".freeze
IGNITE ||= "IGNITE".freeze
GROW ||= "GROW".freeze
COMPREHENSIVE ||= "COMPREHENSIVE".freeze

# BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing)
attr_accessor :edition
Expand Down Expand Up @@ -463,7 +466,7 @@ def valid?
return false unless sales_tax_period_validator.valid?(@sales_tax_period)
organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
return false unless organisation_entity_type_validator.valid?(@organisation_entity_type)
_class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE"])
_class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "IGNITE", "GROW", "COMPREHENSIVE"])
return false unless _class_validator.valid?(@_class)
edition_validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"])
return false unless edition_validator.valid?(@edition)
Expand Down Expand Up @@ -523,7 +526,7 @@ def organisation_entity_type=(organisation_entity_type)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] _class Object to be assigned
def _class=(_class)
validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE"])
validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "IGNITE", "GROW", "COMPREHENSIVE"])
unless validator.valid?(_class)
fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
end
Expand Down
32 changes: 31 additions & 1 deletion lib/xero-ruby/models/files/association.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ module XeroRuby::Files
require 'bigdecimal'

class Association
# Boolean flag to determines whether the file is sent with the document it is attached to on client facing communications. Note- The SendWithObject element is only returned when using /Associations/{ObjectId} endpoint.
attr_accessor :send_with_object

# The name of the associated file. Note- The Name element is only returned when using /Associations/{ObjectId} endpoint.
attr_accessor :name

# The size of the associated file in bytes. Note- The Size element is only returned when using /Associations/{ObjectId} endpoint.
attr_accessor :size

# The unique identifier of the file
attr_accessor :file_id

Expand All @@ -31,6 +40,9 @@ class Association
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'send_with_object' => :'SendWithObject',
:'name' => :'Name',
:'size' => :'Size',
:'file_id' => :'FileId',
:'object_id' => :'ObjectId',
:'object_group' => :'ObjectGroup',
Expand All @@ -41,6 +53,9 @@ def self.attribute_map
# Attribute type mapping.
def self.openapi_types
{
:'send_with_object' => :'Boolean',
:'name' => :'String',
:'size' => :'Integer',
:'file_id' => :'String',
:'object_id' => :'String',
:'object_group' => :'ObjectGroup',
Expand All @@ -63,6 +78,18 @@ def initialize(attributes = {})
h[k.to_sym] = v
}

if attributes.key?(:'send_with_object')
self.send_with_object = attributes[:'send_with_object']
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'size')
self.size = attributes[:'size']
end

if attributes.key?(:'file_id')
self.file_id = attributes[:'file_id']
end
Expand Down Expand Up @@ -98,6 +125,9 @@ def valid?
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
send_with_object == o.send_with_object &&
name == o.name &&
size == o.size &&
file_id == o.file_id &&
object_id == o.object_id &&
object_group == o.object_group &&
Expand All @@ -113,7 +143,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[file_id, object_id, object_group, object_type].hash
[send_with_object, name, size, file_id, object_id, object_group, object_type].hash
end

# Builds the object from hash
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: 3.0.3
The version of the XeroOpenAPI document: 4.0.0
=end

module XeroRuby
VERSION = '6.0.0'
VERSION = '7.0.0'
end

0 comments on commit 39afb5a

Please sign in to comment.