async-firefly 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/async/firefly/about.rb +79 -0
- data/lib/async/firefly/accounts.rb +129 -0
- data/lib/async/firefly/attachments.rb +53 -0
- data/lib/async/firefly/autocomplete.rb +435 -0
- data/lib/async/firefly/available_budgets.rb +59 -0
- data/lib/async/firefly/bills.rb +107 -0
- data/lib/async/firefly/budgets.rb +165 -0
- data/lib/async/firefly/categories.rb +63 -0
- data/lib/async/firefly/charts.rb +73 -0
- data/lib/async/firefly/client.rb +89 -0
- data/lib/async/firefly/configurations.rb +62 -0
- data/lib/async/firefly/currencies.rb +71 -0
- data/lib/async/firefly/data.rb +37 -0
- data/lib/async/firefly/error.rb +57 -0
- data/lib/async/firefly/escape.rb +9 -0
- data/lib/async/firefly/exchange_rates.rb +77 -0
- data/lib/async/firefly/insight.rb +185 -0
- data/lib/async/firefly/links.rb +69 -0
- data/lib/async/firefly/nested.rb +75 -0
- data/lib/async/firefly/object_groups.rb +33 -0
- data/lib/async/firefly/page.rb +139 -0
- data/lib/async/firefly/piggy_banks.rb +153 -0
- data/lib/async/firefly/preferences.rb +58 -0
- data/lib/async/firefly/recurrences.rb +169 -0
- data/lib/async/firefly/redacted.rb +32 -0
- data/lib/async/firefly/representation.rb +99 -0
- data/lib/async/firefly/rule_groups.rb +55 -0
- data/lib/async/firefly/rules.rb +105 -0
- data/lib/async/firefly/search.rb +40 -0
- data/lib/async/firefly/submit.rb +139 -0
- data/lib/async/firefly/summary.rb +45 -0
- data/lib/async/firefly/sums.rb +17 -0
- data/lib/async/firefly/tags.rb +57 -0
- data/lib/async/firefly/transactions.rb +231 -0
- data/lib/async/firefly/user_groups.rb +49 -0
- data/lib/async/firefly/users.rb +35 -0
- data/lib/async/firefly/version.rb +5 -0
- data/lib/async/firefly/webhooks.rb +101 -0
- data/lib/async/firefly/wrapper.rb +65 -0
- data/lib/async/firefly.rb +2 -0
- data/license.md +21 -0
- data/readme.md +498 -0
- metadata +110 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f90a30a418fa36fec833ef10098195310c76bea241a5b50b48b906def3f3106e
|
|
4
|
+
data.tar.gz: 8030cdd358f7b9998dca1bcc805ea7f8ad5701d00cfa89ff64721c7797934299
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 11de04a7f8b75afe632b0a9c5265823a0c8a54190ce049d9a4865259eacc6c8203b719ca3fd6930ea3af7a3febe72c2100039162284aad7995f0a22ab4053d52
|
|
7
|
+
data.tar.gz: d7d2593a527111211acf9b1268731a2f126c8daf3cdcc6d317cc15e6b431c5906d7a47cf67c74378d43a43bef01d5a69ba5262d192cc76f6cfd77cacd089274b
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
require_relative "page"
|
|
2
|
+
|
|
3
|
+
module Async
|
|
4
|
+
module Firefly
|
|
5
|
+
class SystemInfo < Representation
|
|
6
|
+
def data = self.value[:data] || {}
|
|
7
|
+
|
|
8
|
+
def version = self.data[:version]
|
|
9
|
+
|
|
10
|
+
def api_version = self.data[:api_version]
|
|
11
|
+
|
|
12
|
+
def php_version = self.data[:php_version]
|
|
13
|
+
|
|
14
|
+
def os = self.data[:os]
|
|
15
|
+
|
|
16
|
+
def driver = self.data[:driver]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class ReleaseNotes < Representation
|
|
20
|
+
def version = self.value[:version]
|
|
21
|
+
|
|
22
|
+
def release_notes = self.value[:release_notes]
|
|
23
|
+
|
|
24
|
+
def release_notes_markdown = self.value[:release_notes_markdown]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
class CronResultRow < Representation
|
|
28
|
+
def job_fired = self.value[:job_fired]
|
|
29
|
+
|
|
30
|
+
def job_succeeded = self.value[:job_succeeded]
|
|
31
|
+
|
|
32
|
+
def job_errored = self.value[:job_errored]
|
|
33
|
+
|
|
34
|
+
def message = self.value[:message]
|
|
35
|
+
|
|
36
|
+
def user = self.value[:user]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
class CronResult < Representation
|
|
40
|
+
def recurring_transactions = Array(self.value[:recurring_transactions]).map{|row| CronResultRow.new(@resource, value: row, metadata: self.metadata)}
|
|
41
|
+
|
|
42
|
+
def auto_budgets = Array(self.value[:auto_budgets]).map{|row| CronResultRow.new(@resource, value: row, metadata: self.metadata)}
|
|
43
|
+
|
|
44
|
+
def exchange_rates = Array(self.value[:exchange_rates]).map{|row| CronResultRow.new(@resource, value: row, metadata: self.metadata)}
|
|
45
|
+
|
|
46
|
+
def bill_notifications = Array(self.value[:bill_notifications]).map{|row| CronResultRow.new(@resource, value: row, metadata: self.metadata)}
|
|
47
|
+
|
|
48
|
+
def webhooks = Array(self.value[:webhooks]).map{|row| CronResultRow.new(@resource, value: row, metadata: self.metadata)}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
class CurrentUser < Representation
|
|
52
|
+
def self.schema = "User"
|
|
53
|
+
|
|
54
|
+
def created_at = self.attributes[:created_at]
|
|
55
|
+
|
|
56
|
+
def updated_at = self.attributes[:updated_at]
|
|
57
|
+
|
|
58
|
+
def email = self.attributes[:email]
|
|
59
|
+
|
|
60
|
+
def blocked = self.attributes[:blocked]
|
|
61
|
+
|
|
62
|
+
def blocked_code = self.attributes[:blocked_code]
|
|
63
|
+
|
|
64
|
+
def role = self.attributes[:role]
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
module About
|
|
68
|
+
def about = SystemInfo.new(self.with(path: "v1/about"))
|
|
69
|
+
|
|
70
|
+
def current_user = CurrentUser.new(self.with(path: "v1/about/user"))
|
|
71
|
+
|
|
72
|
+
def release_notes(version) = ReleaseNotes.new(self.with(path: "v1/release-notes/" + Firefly.escape(version)))
|
|
73
|
+
|
|
74
|
+
def cron(token, date: nil, force: nil) = CronResult.new(self.with(path: "v1/cron/" + Firefly.escape(token), parameters: {date: date, force: force}.compact))
|
|
75
|
+
|
|
76
|
+
def finish_batch = self.discard(self.with(path: "v1/batch/finish"), method: :post)
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
require_relative "page"
|
|
2
|
+
|
|
3
|
+
module Async
|
|
4
|
+
module Firefly
|
|
5
|
+
class Account < Representation
|
|
6
|
+
def created_at = self.attributes[:created_at]
|
|
7
|
+
|
|
8
|
+
def updated_at = self.attributes[:updated_at]
|
|
9
|
+
|
|
10
|
+
def active = self.attributes[:active]
|
|
11
|
+
|
|
12
|
+
def order = self.attributes[:order]
|
|
13
|
+
|
|
14
|
+
def name = self.attributes[:name]
|
|
15
|
+
|
|
16
|
+
def type = self.attributes[:type]
|
|
17
|
+
|
|
18
|
+
def account_role = self.attributes[:account_role]
|
|
19
|
+
|
|
20
|
+
def object_group_id = self.attributes[:object_group_id]
|
|
21
|
+
|
|
22
|
+
def object_group_order = self.attributes[:object_group_order]
|
|
23
|
+
|
|
24
|
+
def object_group_title = self.attributes[:object_group_title]
|
|
25
|
+
|
|
26
|
+
def object_has_currency_setting = self.attributes[:object_has_currency_setting]
|
|
27
|
+
|
|
28
|
+
def currency_id = self.attributes[:currency_id]
|
|
29
|
+
|
|
30
|
+
def currency_name = self.attributes[:currency_name]
|
|
31
|
+
|
|
32
|
+
def currency_code = self.attributes[:currency_code]
|
|
33
|
+
|
|
34
|
+
def currency_symbol = self.attributes[:currency_symbol]
|
|
35
|
+
|
|
36
|
+
def currency_decimal_places = self.attributes[:currency_decimal_places]
|
|
37
|
+
|
|
38
|
+
def primary_currency_id = self.attributes[:primary_currency_id]
|
|
39
|
+
|
|
40
|
+
def primary_currency_name = self.attributes[:primary_currency_name]
|
|
41
|
+
|
|
42
|
+
def primary_currency_code = self.attributes[:primary_currency_code]
|
|
43
|
+
|
|
44
|
+
def primary_currency_symbol = self.attributes[:primary_currency_symbol]
|
|
45
|
+
|
|
46
|
+
def primary_currency_decimal_places = self.attributes[:primary_currency_decimal_places]
|
|
47
|
+
|
|
48
|
+
def current_balance = self.attributes[:current_balance]
|
|
49
|
+
|
|
50
|
+
def pc_current_balance = self.attributes[:pc_current_balance]
|
|
51
|
+
|
|
52
|
+
def balance_difference = self.attributes[:balance_difference]
|
|
53
|
+
|
|
54
|
+
def pc_balance_difference = self.attributes[:pc_balance_difference]
|
|
55
|
+
|
|
56
|
+
def opening_balance = self.attributes[:opening_balance]
|
|
57
|
+
|
|
58
|
+
def pc_opening_balance = self.attributes[:pc_opening_balance]
|
|
59
|
+
|
|
60
|
+
def virtual_balance = self.attributes[:virtual_balance]
|
|
61
|
+
|
|
62
|
+
def pc_virtual_balance = self.attributes[:pc_virtual_balance]
|
|
63
|
+
|
|
64
|
+
def debt_amount = self.attributes[:debt_amount]
|
|
65
|
+
|
|
66
|
+
def pc_debt_amount = self.attributes[:pc_debt_amount]
|
|
67
|
+
|
|
68
|
+
def current_balance_date = self.attributes[:current_balance_date]
|
|
69
|
+
|
|
70
|
+
def notes = self.attributes[:notes]
|
|
71
|
+
|
|
72
|
+
def monthly_payment_date = self.attributes[:monthly_payment_date]
|
|
73
|
+
|
|
74
|
+
def credit_card_type = self.attributes[:credit_card_type]
|
|
75
|
+
|
|
76
|
+
def account_number = self.attributes[:account_number]
|
|
77
|
+
|
|
78
|
+
def iban = self.attributes[:iban]
|
|
79
|
+
|
|
80
|
+
def bic = self.attributes[:bic]
|
|
81
|
+
|
|
82
|
+
def opening_balance_date = self.attributes[:opening_balance_date]
|
|
83
|
+
|
|
84
|
+
def liability_type = self.attributes[:liability_type]
|
|
85
|
+
|
|
86
|
+
def liability_direction = self.attributes[:liability_direction]
|
|
87
|
+
|
|
88
|
+
def interest = self.attributes[:interest]
|
|
89
|
+
|
|
90
|
+
def interest_period = self.attributes[:interest_period]
|
|
91
|
+
|
|
92
|
+
def include_net_worth = self.attributes[:include_net_worth]
|
|
93
|
+
|
|
94
|
+
def longitude = self.attributes[:longitude]
|
|
95
|
+
|
|
96
|
+
def latitude = self.attributes[:latitude]
|
|
97
|
+
|
|
98
|
+
def zoom_level = self.attributes[:zoom_level]
|
|
99
|
+
|
|
100
|
+
def last_activity = self.attributes[:last_activity]
|
|
101
|
+
|
|
102
|
+
def active? = self.active == true
|
|
103
|
+
|
|
104
|
+
def asset? = self.type == "asset"
|
|
105
|
+
|
|
106
|
+
def transactions(**parameters) = Collection.for(@resource, "transactions", NestedTransactionPage, **parameters)
|
|
107
|
+
|
|
108
|
+
def attachments(**parameters) = Collection.for(@resource, "attachments", NestedAttachmentPage, **parameters)
|
|
109
|
+
|
|
110
|
+
def piggy_banks(**parameters) = Collection.for(@resource, "piggy-banks", NestedPiggyBankPage, **parameters)
|
|
111
|
+
|
|
112
|
+
def update(payload) = self.submit(Account, @resource, payload, method: :put)
|
|
113
|
+
|
|
114
|
+
def delete = self.discard(@resource)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
class AccountPage < Page
|
|
118
|
+
MEMBER = Account
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
module Accounts
|
|
122
|
+
def accounts(**parameters) = Collection.for(self, "v1/accounts", AccountPage, **parameters)
|
|
123
|
+
|
|
124
|
+
def account(id) = Account.new(self.with(path: "v1/accounts/" + Firefly.escape(id)))
|
|
125
|
+
|
|
126
|
+
def create_account(payload) = self.submit(Account, self.with(path: "v1/accounts"), payload, identify: true)
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require_relative "page"
|
|
2
|
+
|
|
3
|
+
module Async
|
|
4
|
+
module Firefly
|
|
5
|
+
class Attachment < Representation
|
|
6
|
+
def created_at = self.attributes[:created_at]
|
|
7
|
+
|
|
8
|
+
def updated_at = self.attributes[:updated_at]
|
|
9
|
+
|
|
10
|
+
def attachable_type = self.attributes[:attachable_type]
|
|
11
|
+
|
|
12
|
+
def attachable_id = self.attributes[:attachable_id]
|
|
13
|
+
|
|
14
|
+
def hash_attribute = self.attributes[:hash]
|
|
15
|
+
|
|
16
|
+
def filename = self.attributes[:filename]
|
|
17
|
+
|
|
18
|
+
def download_url = self.attributes[:download_url]
|
|
19
|
+
|
|
20
|
+
def upload_url = self.attributes[:upload_url]
|
|
21
|
+
|
|
22
|
+
def title = self.attributes[:title]
|
|
23
|
+
|
|
24
|
+
def notes = self.attributes[:notes]
|
|
25
|
+
|
|
26
|
+
def mime = self.attributes[:mime]
|
|
27
|
+
|
|
28
|
+
def size = self.attributes[:size]
|
|
29
|
+
|
|
30
|
+
def update(payload) = self.submit(Attachment, @resource, payload, method: :put)
|
|
31
|
+
|
|
32
|
+
def delete = self.discard(@resource)
|
|
33
|
+
|
|
34
|
+
def download = self.fetch(Download, @resource.with(path: "download"))
|
|
35
|
+
|
|
36
|
+
def upload_file(bytes, content_type: Content::OCTET_STREAM)
|
|
37
|
+
self.upload(Attachment, @resource.with(path: "upload", headers: {"content-type" => content_type}), bytes)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class AttachmentPage < Page
|
|
42
|
+
MEMBER = Attachment
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
module Attachments
|
|
46
|
+
def attachments(**parameters) = Collection.for(self, "v1/attachments", AttachmentPage, **parameters)
|
|
47
|
+
|
|
48
|
+
def attachment(id) = Attachment.new(self.with(path: "v1/attachments/" + Firefly.escape(id)))
|
|
49
|
+
|
|
50
|
+
def create_attachment(payload) = self.submit(Attachment, self.with(path: "v1/attachments"), payload, identify: true)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
require_relative "page"
|
|
2
|
+
|
|
3
|
+
module Async
|
|
4
|
+
module Firefly
|
|
5
|
+
class AutocompleteAccount < Representation
|
|
6
|
+
def id = self.value[:id]
|
|
7
|
+
|
|
8
|
+
def name = self.value[:name]
|
|
9
|
+
|
|
10
|
+
def name_with_balance = self.value[:name_with_balance]
|
|
11
|
+
|
|
12
|
+
def active = self.value[:active]
|
|
13
|
+
|
|
14
|
+
def type = self.value[:type]
|
|
15
|
+
|
|
16
|
+
def currency_id = self.value[:currency_id]
|
|
17
|
+
|
|
18
|
+
def currency_name = self.value[:currency_name]
|
|
19
|
+
|
|
20
|
+
def currency_code = self.value[:currency_code]
|
|
21
|
+
|
|
22
|
+
def currency_symbol = self.value[:currency_symbol]
|
|
23
|
+
|
|
24
|
+
def currency_decimal_places = self.value[:currency_decimal_places]
|
|
25
|
+
|
|
26
|
+
def account_currency_id = self.value[:account_currency_id]
|
|
27
|
+
|
|
28
|
+
def account_currency_name = self.value[:account_currency_name]
|
|
29
|
+
|
|
30
|
+
def account_currency_code = self.value[:account_currency_code]
|
|
31
|
+
|
|
32
|
+
def account_currency_symbol = self.value[:account_currency_symbol]
|
|
33
|
+
|
|
34
|
+
def account_currency_decimal_places = self.value[:account_currency_decimal_places]
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class AutocompleteAccounts < Representation
|
|
38
|
+
include Enumerable
|
|
39
|
+
|
|
40
|
+
def each(&block)
|
|
41
|
+
if block
|
|
42
|
+
self.deconstruct.each{|record| block.call(AutocompleteAccount.new(@resource, value: record, metadata: self.metadata))}
|
|
43
|
+
else
|
|
44
|
+
self.to_enum(:each)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
class AutocompleteBill < Representation
|
|
50
|
+
def id = self.value[:id]
|
|
51
|
+
|
|
52
|
+
def name = self.value[:name]
|
|
53
|
+
|
|
54
|
+
def active = self.value[:active]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class AutocompleteBills < Representation
|
|
58
|
+
include Enumerable
|
|
59
|
+
|
|
60
|
+
def each(&block)
|
|
61
|
+
if block
|
|
62
|
+
self.deconstruct.each{|record| block.call(AutocompleteBill.new(@resource, value: record, metadata: self.metadata))}
|
|
63
|
+
else
|
|
64
|
+
self.to_enum(:each)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
class AutocompleteBudget < Representation
|
|
70
|
+
def id = self.value[:id]
|
|
71
|
+
|
|
72
|
+
def name = self.value[:name]
|
|
73
|
+
|
|
74
|
+
def active = self.value[:active]
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
class AutocompleteBudgets < Representation
|
|
78
|
+
include Enumerable
|
|
79
|
+
|
|
80
|
+
def each(&block)
|
|
81
|
+
if block
|
|
82
|
+
self.deconstruct.each{|record| block.call(AutocompleteBudget.new(@resource, value: record, metadata: self.metadata))}
|
|
83
|
+
else
|
|
84
|
+
self.to_enum(:each)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
class AutocompleteCategory < Representation
|
|
90
|
+
def id = self.value[:id]
|
|
91
|
+
|
|
92
|
+
def name = self.value[:name]
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
class AutocompleteCategories < Representation
|
|
96
|
+
include Enumerable
|
|
97
|
+
|
|
98
|
+
def each(&block)
|
|
99
|
+
if block
|
|
100
|
+
self.deconstruct.each{|record| block.call(AutocompleteCategory.new(@resource, value: record, metadata: self.metadata))}
|
|
101
|
+
else
|
|
102
|
+
self.to_enum(:each)
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
class AutocompleteCurrency < Representation
|
|
108
|
+
def id = self.value[:id]
|
|
109
|
+
|
|
110
|
+
def name = self.value[:name]
|
|
111
|
+
|
|
112
|
+
def code = self.value[:code]
|
|
113
|
+
|
|
114
|
+
def symbol = self.value[:symbol]
|
|
115
|
+
|
|
116
|
+
def decimal_places = self.value[:decimal_places]
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
class AutocompleteCurrencies < Representation
|
|
120
|
+
include Enumerable
|
|
121
|
+
|
|
122
|
+
def each(&block)
|
|
123
|
+
if block
|
|
124
|
+
self.deconstruct.each{|record| block.call(AutocompleteCurrency.new(@resource, value: record, metadata: self.metadata))}
|
|
125
|
+
else
|
|
126
|
+
self.to_enum(:each)
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
class AutocompleteObjectGroup < Representation
|
|
132
|
+
def id = self.value[:id]
|
|
133
|
+
|
|
134
|
+
def name = self.value[:name]
|
|
135
|
+
|
|
136
|
+
def title = self.value[:title]
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
class AutocompleteObjectGroups < Representation
|
|
140
|
+
include Enumerable
|
|
141
|
+
|
|
142
|
+
def each(&block)
|
|
143
|
+
if block
|
|
144
|
+
self.deconstruct.each{|record| block.call(AutocompleteObjectGroup.new(@resource, value: record, metadata: self.metadata))}
|
|
145
|
+
else
|
|
146
|
+
self.to_enum(:each)
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
class AutocompletePiggyBalance < Representation
|
|
152
|
+
def id = self.value[:id]
|
|
153
|
+
|
|
154
|
+
def name = self.value[:name]
|
|
155
|
+
|
|
156
|
+
def name_with_balance = self.value[:name_with_balance]
|
|
157
|
+
|
|
158
|
+
def currency_id = self.value[:currency_id]
|
|
159
|
+
|
|
160
|
+
def currency_code = self.value[:currency_code]
|
|
161
|
+
|
|
162
|
+
def currency_symbol = self.value[:currency_symbol]
|
|
163
|
+
|
|
164
|
+
def currency_decimal_places = self.value[:currency_decimal_places]
|
|
165
|
+
|
|
166
|
+
def object_group_id = self.value[:object_group_id]
|
|
167
|
+
|
|
168
|
+
def object_group_title = self.value[:object_group_title]
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
class AutocompletePiggyBalances < Representation
|
|
172
|
+
include Enumerable
|
|
173
|
+
|
|
174
|
+
def each(&block)
|
|
175
|
+
if block
|
|
176
|
+
self.deconstruct.each{|record| block.call(AutocompletePiggyBalance.new(@resource, value: record, metadata: self.metadata))}
|
|
177
|
+
else
|
|
178
|
+
self.to_enum(:each)
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
class AutocompleteRecurrence < Representation
|
|
184
|
+
def id = self.value[:id]
|
|
185
|
+
|
|
186
|
+
def name = self.value[:name]
|
|
187
|
+
|
|
188
|
+
def description = self.value[:description]
|
|
189
|
+
|
|
190
|
+
def active = self.value[:active]
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
class AutocompleteRecurrences < Representation
|
|
194
|
+
include Enumerable
|
|
195
|
+
|
|
196
|
+
def each(&block)
|
|
197
|
+
if block
|
|
198
|
+
self.deconstruct.each{|record| block.call(AutocompleteRecurrence.new(@resource, value: record, metadata: self.metadata))}
|
|
199
|
+
else
|
|
200
|
+
self.to_enum(:each)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
class AutocompleteRule < Representation
|
|
206
|
+
def id = self.value[:id]
|
|
207
|
+
|
|
208
|
+
def name = self.value[:name]
|
|
209
|
+
|
|
210
|
+
def description = self.value[:description]
|
|
211
|
+
|
|
212
|
+
def active = self.value[:active]
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
class AutocompleteRules < Representation
|
|
216
|
+
include Enumerable
|
|
217
|
+
|
|
218
|
+
def each(&block)
|
|
219
|
+
if block
|
|
220
|
+
self.deconstruct.each{|record| block.call(AutocompleteRule.new(@resource, value: record, metadata: self.metadata))}
|
|
221
|
+
else
|
|
222
|
+
self.to_enum(:each)
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
class AutocompleteRuleGroup < Representation
|
|
228
|
+
def id = self.value[:id]
|
|
229
|
+
|
|
230
|
+
def name = self.value[:name]
|
|
231
|
+
|
|
232
|
+
def description = self.value[:description]
|
|
233
|
+
|
|
234
|
+
def active = self.value[:active]
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
class AutocompleteRuleGroups < Representation
|
|
238
|
+
include Enumerable
|
|
239
|
+
|
|
240
|
+
def each(&block)
|
|
241
|
+
if block
|
|
242
|
+
self.deconstruct.each{|record| block.call(AutocompleteRuleGroup.new(@resource, value: record, metadata: self.metadata))}
|
|
243
|
+
else
|
|
244
|
+
self.to_enum(:each)
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
class AutocompleteTag < Representation
|
|
250
|
+
def id = self.value[:id]
|
|
251
|
+
|
|
252
|
+
def name = self.value[:name]
|
|
253
|
+
|
|
254
|
+
def tag = self.value[:tag]
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
class AutocompleteTags < Representation
|
|
258
|
+
include Enumerable
|
|
259
|
+
|
|
260
|
+
def each(&block)
|
|
261
|
+
if block
|
|
262
|
+
self.deconstruct.each{|record| block.call(AutocompleteTag.new(@resource, value: record, metadata: self.metadata))}
|
|
263
|
+
else
|
|
264
|
+
self.to_enum(:each)
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
class AutocompleteTransaction < Representation
|
|
270
|
+
def id = self.value[:id]
|
|
271
|
+
|
|
272
|
+
def transaction_group_id = self.value[:transaction_group_id]
|
|
273
|
+
|
|
274
|
+
def name = self.value[:name]
|
|
275
|
+
|
|
276
|
+
def description = self.value[:description]
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
class AutocompleteTransactions < Representation
|
|
280
|
+
include Enumerable
|
|
281
|
+
|
|
282
|
+
def each(&block)
|
|
283
|
+
if block
|
|
284
|
+
self.deconstruct.each{|record| block.call(AutocompleteTransaction.new(@resource, value: record, metadata: self.metadata))}
|
|
285
|
+
else
|
|
286
|
+
self.to_enum(:each)
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
class AutocompleteTransactionType < Representation
|
|
292
|
+
def id = self.value[:id]
|
|
293
|
+
|
|
294
|
+
def name = self.value[:name]
|
|
295
|
+
|
|
296
|
+
def type = self.value[:type]
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
class AutocompleteTransactionTypes < Representation
|
|
300
|
+
include Enumerable
|
|
301
|
+
|
|
302
|
+
def each(&block)
|
|
303
|
+
if block
|
|
304
|
+
self.deconstruct.each{|record| block.call(AutocompleteTransactionType.new(@resource, value: record, metadata: self.metadata))}
|
|
305
|
+
else
|
|
306
|
+
self.to_enum(:each)
|
|
307
|
+
end
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
class AutocompleteTransactionWithMeta < Representation
|
|
312
|
+
def id = self.value[:id]
|
|
313
|
+
|
|
314
|
+
def transaction_group_id = self.value[:transaction_group_id]
|
|
315
|
+
|
|
316
|
+
def name = self.value[:name]
|
|
317
|
+
|
|
318
|
+
def description = self.value[:description]
|
|
319
|
+
|
|
320
|
+
def date = self.value[:date]
|
|
321
|
+
|
|
322
|
+
def currency_code = self.value[:currency_code]
|
|
323
|
+
|
|
324
|
+
def amount = self.value[:amount]
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
class AutocompleteTransactionsWithMeta < Representation
|
|
328
|
+
include Enumerable
|
|
329
|
+
|
|
330
|
+
def each(&block)
|
|
331
|
+
if block
|
|
332
|
+
self.deconstruct.each{|record| block.call(AutocompleteTransactionWithMeta.new(@resource, value: record, metadata: self.metadata))}
|
|
333
|
+
else
|
|
334
|
+
self.to_enum(:each)
|
|
335
|
+
end
|
|
336
|
+
end
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
module Autocomplete
|
|
340
|
+
def autocomplete_accounts(query: nil, limit: nil, date: nil, types: nil)
|
|
341
|
+
parameters = {query: query, limit: limit, date: date}.compact
|
|
342
|
+
|
|
343
|
+
if types
|
|
344
|
+
parameters[:types] = Array(types).join(",")
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
self.fetch(AutocompleteAccounts, self.with(path: "v1/autocomplete/accounts", parameters: parameters))
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
def autocomplete_bills(query: nil, limit: nil)
|
|
351
|
+
parameters = {query: query, limit: limit}.compact
|
|
352
|
+
|
|
353
|
+
self.fetch(AutocompleteBills, self.with(path: "v1/autocomplete/bills", parameters: parameters))
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
def autocomplete_budgets(query: nil, limit: nil)
|
|
357
|
+
parameters = {query: query, limit: limit}.compact
|
|
358
|
+
|
|
359
|
+
self.fetch(AutocompleteBudgets, self.with(path: "v1/autocomplete/budgets", parameters: parameters))
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
def autocomplete_categories(query: nil, limit: nil)
|
|
363
|
+
parameters = {query: query, limit: limit}.compact
|
|
364
|
+
|
|
365
|
+
self.fetch(AutocompleteCategories, self.with(path: "v1/autocomplete/categories", parameters: parameters))
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
def autocomplete_currencies(query: nil, limit: nil)
|
|
369
|
+
parameters = {query: query, limit: limit}.compact
|
|
370
|
+
|
|
371
|
+
self.fetch(AutocompleteCurrencies, self.with(path: "v1/autocomplete/currencies", parameters: parameters))
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
def autocomplete_object_groups(query: nil, limit: nil)
|
|
375
|
+
parameters = {query: query, limit: limit}.compact
|
|
376
|
+
|
|
377
|
+
self.fetch(AutocompleteObjectGroups, self.with(path: "v1/autocomplete/object-groups", parameters: parameters))
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
def autocomplete_piggy_banks(query: nil, limit: nil)
|
|
381
|
+
parameters = {query: query, limit: limit}.compact
|
|
382
|
+
|
|
383
|
+
self.fetch(AutocompletePiggyBalances, self.with(path: "v1/autocomplete/piggy-banks", parameters: parameters))
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
def autocomplete_recurrences(query: nil, limit: nil)
|
|
387
|
+
parameters = {query: query, limit: limit}.compact
|
|
388
|
+
|
|
389
|
+
self.fetch(AutocompleteRecurrences, self.with(path: "v1/autocomplete/recurring", parameters: parameters))
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
def autocomplete_rule_groups(query: nil, limit: nil)
|
|
393
|
+
parameters = {query: query, limit: limit}.compact
|
|
394
|
+
|
|
395
|
+
self.fetch(AutocompleteRuleGroups, self.with(path: "v1/autocomplete/rule-groups", parameters: parameters))
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
def autocomplete_rules(query: nil, limit: nil)
|
|
399
|
+
parameters = {query: query, limit: limit}.compact
|
|
400
|
+
|
|
401
|
+
self.fetch(AutocompleteRules, self.with(path: "v1/autocomplete/rules", parameters: parameters))
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
def autocomplete_subscriptions(query: nil, limit: nil)
|
|
405
|
+
parameters = {query: query, limit: limit}.compact
|
|
406
|
+
|
|
407
|
+
self.fetch(AutocompleteBills, self.with(path: "v1/autocomplete/subscriptions", parameters: parameters))
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
def autocomplete_tags(query: nil, limit: nil)
|
|
411
|
+
parameters = {query: query, limit: limit}.compact
|
|
412
|
+
|
|
413
|
+
self.fetch(AutocompleteTags, self.with(path: "v1/autocomplete/tags", parameters: parameters))
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
def autocomplete_transaction_types(query: nil, limit: nil)
|
|
417
|
+
parameters = {query: query, limit: limit}.compact
|
|
418
|
+
|
|
419
|
+
self.fetch(AutocompleteTransactionTypes, self.with(path: "v1/autocomplete/transaction-types", parameters: parameters))
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
def autocomplete_transactions(query: nil, limit: nil)
|
|
423
|
+
parameters = {query: query, limit: limit}.compact
|
|
424
|
+
|
|
425
|
+
self.fetch(AutocompleteTransactions, self.with(path: "v1/autocomplete/transactions", parameters: parameters))
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
def autocomplete_transactions_with_meta(query: nil, limit: nil)
|
|
429
|
+
parameters = {query: query, limit: limit}.compact
|
|
430
|
+
|
|
431
|
+
self.fetch(AutocompleteTransactionsWithMeta, self.with(path: "v1/autocomplete/transactions-with-meta", parameters: parameters))
|
|
432
|
+
end
|
|
433
|
+
end
|
|
434
|
+
end
|
|
435
|
+
end
|