Class: KaChing::ApiV1::AuditLogs
- Inherits:
-
Object
- Object
- KaChing::ApiV1::AuditLogs
- Extended by:
- Forwardable
- Defined in:
- lib/ka_ching/api_v1/audit_logs.rb
Overview
AuditLog Endpoint for the KaChing API V1
Instance Method Summary collapse
-
#initialize(conn:, api_url:) ⇒ AuditLogs
constructor
A new instance of AuditLogs.
-
#of_year(tenant_account_id:, year:) {|Faraday::Response| ... } ⇒ Hash
Get all bookings for the current tenant of a specific year.
-
#of_year_month(tenant_account_id:, year:, month:) {|Faraday::Response| ... } ⇒ Hash
Get all bookings for the current tenant of a specific year, month.
-
#of_year_month_day(tenant_account_id:, year:, month:, day:) {|Faraday::Response| ... } ⇒ Hash
Get all bookings for the current tenant of a specific year, month, day.
Constructor Details
#initialize(conn:, api_url:) ⇒ AuditLogs
Returns a new instance of AuditLogs.
13 14 15 16 |
# File 'lib/ka_ching/api_v1/audit_logs.rb', line 13 def initialize(conn:, api_url:) @conn = conn @api_url = api_url end |
Instance Method Details
#of_year(tenant_account_id:, year:) {|Faraday::Response| ... } ⇒ Hash
Get all bookings for the current tenant of a specific year
27 28 29 30 31 32 33 |
# File 'lib/ka_ching/api_v1/audit_logs.rb', line 27 def of_year(tenant_account_id:, year:) res = get(build_url(tenant_account_id: tenant_account_id), { year: year }) yield res if block_given? JSON.parse(res.body)['audit_logs'] end |
#of_year_month(tenant_account_id:, year:, month:) {|Faraday::Response| ... } ⇒ Hash
Get all bookings for the current tenant of a specific year, month
45 46 47 48 49 50 |
# File 'lib/ka_ching/api_v1/audit_logs.rb', line 45 def of_year_month(tenant_account_id:, year:, month:) res = get(build_url(tenant_account_id: tenant_account_id), { year: year, month: month }) yield res if block_given? JSON.parse(res.body)['audit_logs'] end |
#of_year_month_day(tenant_account_id:, year:, month:, day:) {|Faraday::Response| ... } ⇒ Hash
Get all bookings for the current tenant of a specific year, month, day
63 64 65 66 67 68 |
# File 'lib/ka_ching/api_v1/audit_logs.rb', line 63 def of_year_month_day(tenant_account_id:, year:, month:, day:) res = get(build_url(tenant_account_id: tenant_account_id), { year: year, month: month, day: day }) yield res if block_given? JSON.parse(res.body)['audit_logs'] end |