forked from twilio/twilio-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding support for usage records and usage triggers
- Loading branch information
1 parent
8cd9096
commit f4f26ab
Showing
6 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Twilio | ||
module REST | ||
class Usage < InstanceResource | ||
def initialize(uri, client, params={}) | ||
super | ||
resource :records, :triggers | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Twilio | ||
module REST | ||
class Records < ListResource | ||
|
||
SUBRESOURCES = [:daily, :monthly, :yearly, :all_time, :today, :yesterday, | ||
:this_month, :last_month] | ||
|
||
def initialize(uri, client) | ||
super | ||
@list_key = 'usage_records' | ||
end | ||
|
||
def method_missing(method, *args) | ||
super unless SUBRESOURCES.include? method | ||
self.class.new "#{@uri}/#{twilify(method)}", @client | ||
end | ||
end | ||
|
||
class Record < InstanceResource; end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Twilio | ||
module REST | ||
class Triggers < ListResource | ||
def initialize(uri, client) | ||
super | ||
@list_key = 'usage_triggers' | ||
end | ||
end | ||
|
||
class Trigger < InstanceResource; end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Twilio | ||
VERSION = '3.8.0' | ||
VERSION = '3.9.0' | ||
end |