Skip to content

Commit 82a133e

Browse files
committed
Include invoice status
1 parent 46e825b commit 82a133e

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

lib/travis/api/v3/models/invoice.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
module Travis::API::V3
22
class Models::Invoice
3-
attr_reader :id, :created_at, :url, :amount_due
3+
attr_reader :id, :created_at, :status, :url, :amount_due
44

55
def initialize(attributes = {})
66
@id = attributes.fetch('id')
77
@created_at = attributes.fetch('created_at') && DateTime.parse(attributes.fetch('created_at'))
8+
@status = attributes.fetch('status')
89
@url = attributes.fetch('url')
910
@amount_due = attributes.fetch('amount_due')
1011
end
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Travis::API::V3
22
class Models::V2AddonUsage
3-
attr_reader :id, :addon_id, :addon_quantity, :addon_usage, :remaining, :active
3+
attr_reader :id, :addon_id, :addon_quantity, :addon_usage, :remaining, :active, :status
44

55
def initialize(attrs)
66
@id = attrs.fetch('id')
@@ -9,6 +9,7 @@ def initialize(attrs)
99
@addon_usage = attrs.fetch('addon_usage')
1010
@remaining = attrs.fetch('remaining')
1111
@active = attrs.fetch('active')
12+
@status = attrs.fetch('status')
1213
end
1314
end
1415
end

lib/travis/api/v3/renderer/invoice.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Travis::API::V3
22
class Renderer::Invoice < ModelRenderer
3-
representation(:standard, :id, :created_at, :url, :amount_due)
3+
representation(:standard, :id, :created_at, :status, :url, :amount_due)
44
end
55
end
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Travis::API::V3
22
class Renderer::V2AddonUsage < ModelRenderer
3-
representation(:standard, :id, :addon_id, :addon_quantity, :addon_usage, :remaining, :active)
4-
representation(:minimal, :id, :addon_id, :addon_quantity, :addon_usage, :remaining, :active)
3+
representation(:standard, :id, :addon_id, :addon_quantity, :addon_usage, :remaining, :active, :status)
4+
representation(:minimal, :id, :addon_id, :addon_quantity, :addon_usage, :remaining, :active, :status)
55
end
66
end

0 commit comments

Comments
 (0)