Skip to content

Commit

Permalink
PETOSS-345 - Fix incorrect documentation generated by OpenAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
Raghunath-S-S-J committed Feb 2, 2024
1 parent f9f1b39 commit aa55b93
Show file tree
Hide file tree
Showing 4 changed files with 1,521 additions and 96 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
xero-ruby (4.4.0)
xero-ruby (5.0.0)
faraday (>= 2.0, < 3.0)
json (~> 2.1, >= 2.1.0)
json-jwt (~> 1.16, >= 1.16.3)
Expand Down
69 changes: 39 additions & 30 deletions docs/files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,28 @@
"type" : "string",
"description" : "The Object Type",
"enum" : [ "Unknown", "Accpay", "AccPayCredit", "AccPayPayment", "AccRec", "AccRecCredit", "AccRecPayment", "Adjustment", "ApCreditPayment", "ApOverPayment", "ApOverPaymentPayment", "ApOverPaymentSourcePayment", "ApPrepayment", "ApPrepaymentPayment", "ApPrepaymentSourcePayment", "ArCreditPayment", "ArOverPayment", "ArOverpaymentPayment", "ArOverpaymentSourcePayment", "ArPrepayment", "ArPrepaymentPayment", "ArPrepaymentSourcePayment", "CashPaid", "CashRec", "ExpPayment", "ManJournal", "PurchaseOrder", "Receipt", "Transfer", "Account", "Contact", "Business", "Employee", "Person", "User", "Org", "FixedAsset", "PayRun", "PriceListItem", "Bank", "Current", "Equity", "Expense", "Fixed", "Liability", "Prepayment", "Revenue", "Sales", "Overheads", "Depreciatn", "OtherIncome", "DirectCosts", "Currliab", "Termliab", "NonCurrent", "SalesQuote" ]
};
defs["UploadObject"] = {
"title" : "",
"required" : [ "body", "filename", "name" ],
"type" : "object",
"properties" : {
"body" : {
"type" : "string",
"format" : "byte"
},
"name" : {
"type" : "string",
"description" : "exact name of the file you are uploading"
},
"filename" : {
"type" : "string"
},
"mimeType" : {
"type" : "string"
}
},
"description" : ""
};
defs["User"] = {
"title" : "",
Expand Down Expand Up @@ -1234,11 +1256,10 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

begin
response = xero_client.accounting_api.create_file_association(xero_tenant_idfile_idassociation, idempotency_key)
response = xero_client.accounting_api.create_file_association(xero_tenant_id, file_id, association, idempotency_key)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling create_file_association: #{e}"
Expand Down Expand Up @@ -1407,7 +1428,7 @@ <h3>Usage and SDK Samples</h3>
idempotency_key = 'KEY_VALUE'

begin
response = xero_client.accounting_api.create_folder(xero_tenant_idfolder, idempotency_key)
response = xero_client.accounting_api.create_folder(xero_tenant_id, folder, idempotency_key)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling create_folder: #{e}"
Expand Down Expand Up @@ -1541,10 +1562,9 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
response = xero_client.accounting_api.delete_file(xero_tenant_idfile_id)
response = xero_client.accounting_api.delete_file(xero_tenant_id, file_id)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling delete_file: #{e}"
Expand Down Expand Up @@ -1655,12 +1675,10 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
response = xero_client.accounting_api.delete_file_association(xero_tenant_idfile_idobject_id)
response = xero_client.accounting_api.delete_file_association(xero_tenant_id, file_id, object_id)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling delete_file_association: #{e}"
Expand Down Expand Up @@ -1797,10 +1815,9 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
response = xero_client.accounting_api.delete_folder(xero_tenant_idfolder_id)
response = xero_client.accounting_api.delete_folder(xero_tenant_id, folder_id)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling delete_folder: #{e}"
Expand Down Expand Up @@ -1911,14 +1928,13 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
object_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
pagesize = 50
page = 2
sort = 'Associations/{ObjectId}?sort=CreatedDateUtc'
direction = 'Associations/{ObjectId}?sort=CreatedDateUtc&direction=DESC'

begin
response = xero_client.accounting_api.get_associations_by_object(xero_tenant_idobject_id, pagesizepagesortdirection)
response = xero_client.accounting_api.get_associations_by_object(xero_tenant_id, object_id, pagesize, page, sort, direction)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_associations_by_object: #{e}"
Expand Down Expand Up @@ -2120,10 +2136,10 @@ <h3>Usage and SDK Samples</h3>
<pre class="prettyprint"><code class="language-ruby">xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
objectIds =
objectIds = []

begin
response = xero_client.accounting_api.get_associations_count(xero_tenant_idobjectIds)
response = xero_client.accounting_api.get_associations_count(xero_tenant_id, objectIds)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_associations_count: #{e}"
Expand Down Expand Up @@ -2239,10 +2255,9 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
response = xero_client.accounting_api.get_file(xero_tenant_idfile_id)
response = xero_client.accounting_api.get_file(xero_tenant_id, file_id)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_file: #{e}"
Expand Down Expand Up @@ -2358,10 +2373,9 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
response = xero_client.accounting_api.get_file_associations(xero_tenant_idfile_id)
response = xero_client.accounting_api.get_file_associations(xero_tenant_id, file_id)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_file_associations: #{e}"
Expand Down Expand Up @@ -2477,10 +2491,9 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
response = xero_client.accounting_api.get_file_content(xero_tenant_idfile_id)
response = xero_client.accounting_api.get_file_content(xero_tenant_id, file_id)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_file_content: #{e}"
Expand Down Expand Up @@ -2600,7 +2613,7 @@ <h3>Usage and SDK Samples</h3>
sort = 'CreatedDateUTC DESC'

begin
response = xero_client.accounting_api.get_files(xero_tenant_id, pagesizepagesort)
response = xero_client.accounting_api.get_files(xero_tenant_id, pagesize, page, sort)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_files: #{e}"
Expand Down Expand Up @@ -2750,10 +2763,9 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'

begin
response = xero_client.accounting_api.get_folder(xero_tenant_idfolder_id)
response = xero_client.accounting_api.get_folder(xero_tenant_id, folder_id)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_folder: #{e}"
Expand Down Expand Up @@ -3065,11 +3077,10 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
file_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

begin
response = xero_client.accounting_api.update_file(xero_tenant_idfile_idfileObject, idempotency_key)
response = xero_client.accounting_api.update_file(xero_tenant_id, file_id, fileObject, idempotency_key)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling update_file: #{e}"
Expand Down Expand Up @@ -3236,11 +3247,10 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
idempotency_key = 'KEY_VALUE'

begin
response = xero_client.accounting_api.update_folder(xero_tenant_idfolder_idfolder, idempotency_key)
response = xero_client.accounting_api.update_folder(xero_tenant_id, folder_id, folder, idempotency_key)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling update_folder: #{e}"
Expand Down Expand Up @@ -3413,7 +3423,7 @@ <h3>Usage and SDK Samples</h3>
mimeType = 'mimeType_example'

begin
response = xero_client.accounting_api.upload_file(xero_tenant_idbodynamefilename, idempotency_keymimeType)
response = xero_client.accounting_api.upload_file(xero_tenant_id, body, name, filename, idempotency_key, mimeType)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling upload_file: #{e}"
Expand Down Expand Up @@ -3610,15 +3620,14 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
folder_id = '4ff1e5cc-9835-40d5-bb18-09fdb118db9c'
body = BYTE_ARRAY_DATA_HERE
name = 'name_example'
filename = 'filename_example'
idempotency_key = 'KEY_VALUE'
mimeType = 'mimeType_example'

begin
response = xero_client.accounting_api.upload_file_to_folder(xero_tenant_idfolder_idbodynamefilename, idempotency_keymimeType)
response = xero_client.accounting_api.upload_file_to_folder(xero_tenant_id, folder_id, body, name, filename, idempotency_key, mimeType)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling upload_file_to_folder: #{e}"
Expand Down
19 changes: 9 additions & 10 deletions docs/finance/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2820,7 +2820,7 @@ <h3>Usage and SDK Samples</h3>
end_month = '2021-09'

begin
response = xero_client.accounting_api.get_accounting_activity_account_usage(xero_tenant_id, start_monthend_month)
response = xero_client.accounting_api.get_accounting_activity_account_usage(xero_tenant_id, start_month, end_month)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_accounting_activity_account_usage: #{e}"
Expand Down Expand Up @@ -3285,13 +3285,12 @@ <h3>Usage and SDK Samples</h3>

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
bank_account_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
bank_account_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d'
from_date = '2020-07-01'
to_date = '2021-06-30'
summary_only = true

begin
response = xero_client.accounting_api.get_bank_statement_accounting(xero_tenant_idbank_account_idfrom_dateto_date, summary_only)
response = xero_client.accounting_api.get_bank_statement_accounting(xero_tenant_id, bank_account_id, from_date, to_date, summary_only)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_bank_statement_accounting: #{e}"
Expand Down Expand Up @@ -3483,7 +3482,7 @@ <h3>Usage and SDK Samples</h3>
begin_date = '2021-09-15'

begin
response = xero_client.accounting_api.get_cash_validation(xero_tenant_id, balance_dateas_at_system_datebegin_date)
response = xero_client.accounting_api.get_cash_validation(xero_tenant_id, balance_date, as_at_system_date, begin_date)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_cash_validation: #{e}"
Expand Down Expand Up @@ -3755,7 +3754,7 @@ <h3>Usage and SDK Samples</h3>
end_date = '2021-09-15'

begin
response = xero_client.accounting_api.get_financial_statement_cashflow(xero_tenant_id, start_dateend_date)
response = xero_client.accounting_api.get_financial_statement_cashflow(xero_tenant_id, start_date, end_date)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_financial_statement_cashflow: #{e}"
Expand Down Expand Up @@ -3885,13 +3884,13 @@ <h3>Usage and SDK Samples</h3>
<pre class="prettyprint"><code class="language-ruby">xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_ids = ["00000000-0000-0000-0000-000000000000","00000000-0000-0000-0000-000000000000"]
contact_ids = [["00000000-0000-0000-0000-000000000000","00000000-0000-0000-0000-000000000000"]]
include_manual_journals = true
start_date = '2020-09-15'
end_date = '2020-09-15'

begin
response = xero_client.accounting_api.get_financial_statement_contacts_expense(xero_tenant_id, contact_idsinclude_manual_journalsstart_dateend_date)
response = xero_client.accounting_api.get_financial_statement_contacts_expense(xero_tenant_id, contact_ids, include_manual_journals, start_date, end_date)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_financial_statement_contacts_expense: #{e}"
Expand Down Expand Up @@ -4070,13 +4069,13 @@ <h3>Usage and SDK Samples</h3>
<pre class="prettyprint"><code class="language-ruby">xero_client.set_token_set(user.token_set)

xero_tenant_id = 'YOUR_XERO_TENANT_ID'
contact_ids = ["00000000-0000-0000-0000-000000000000","00000000-0000-0000-0000-000000000000"]
contact_ids = [["00000000-0000-0000-0000-000000000000","00000000-0000-0000-0000-000000000000"]]
include_manual_journals = true
start_date = '2020-09-15'
end_date = '2020-09-15'

begin
response = xero_client.accounting_api.get_financial_statement_contacts_revenue(xero_tenant_id, contact_idsinclude_manual_journalsstart_dateend_date)
response = xero_client.accounting_api.get_financial_statement_contacts_revenue(xero_tenant_id, contact_ids, include_manual_journals, start_date, end_date)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_financial_statement_contacts_revenue: #{e}"
Expand Down Expand Up @@ -4259,7 +4258,7 @@ <h3>Usage and SDK Samples</h3>
end_date = '2021-09-15'

begin
response = xero_client.accounting_api.get_financial_statement_profit_and_loss(xero_tenant_id, start_dateend_date)
response = xero_client.accounting_api.get_financial_statement_profit_and_loss(xero_tenant_id, start_date, end_date)
return response
rescue XeroRuby::ApiError => e
puts "Exception when calling get_financial_statement_profit_and_loss: #{e}"
Expand Down
Loading

0 comments on commit aa55b93

Please sign in to comment.