Skip to content

Commit 0a6e9db

Browse files
Release_2025-07-21
Release 2025 07 21
2 parents fe55d13 + ae726a6 commit 0a6e9db

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
module Travis::API::V3
22
class Models::V2Addon
3-
attr_reader :id, :name, :type, :current_usage, :recurring
3+
attr_reader :id, :name, :type, :current_usage, :recurring, :free
44

55
def initialize(attrs)
66
@id = attrs.fetch('id')
77
@name = attrs.fetch('name')
88
@type = attrs.fetch('type')
99
@current_usage = attrs['current_usage'] && Models::V2AddonUsage.new(attrs['current_usage'])
1010
@recurring = attrs['recurring']
11+
@free = attrs['free']
1112
end
1213
end
1314
end

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Travis::API::V3
22
class Renderer::V2Addon < ModelRenderer
3-
representation(:standard, :id, :name, :type, :current_usage, :recurring)
4-
representation(:minimal, :id, :name, :type, :current_usage, :recurring)
3+
representation(:standard, :id, :name, :type, :current_usage, :recurring, :free)
4+
representation(:minimal, :id, :name, :type, :current_usage, :recurring, :free)
55

66
def current_usage
77
Renderer.render_model(model.current_usage, mode: :standard) unless model.current_usage.nil?

spec/support/billing_spec_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def billing_addons_response_body
167167
"name" => "OSS Build Credits",
168168
"type" => "credit_public",
169169
"recurring" => false,
170+
"free" => false,
170171
"current_usage" => {
171172
"id" => 1,
172173
"addon_id" => 1,
@@ -184,6 +185,7 @@ def billing_addons_response_body
184185
"name" => "Build Credits",
185186
"type" => "credit_private",
186187
"recurring" => false,
188+
"free" => false,
187189
"current_usage" => {
188190
"id" => 2,
189191
"addon_id" => 2,

spec/v3/services/v2_subscriptions/all_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
'name' => 'OSS Build Credits',
186186
'type' => 'credit_public',
187187
'recurring' => false,
188+
'free' => false,
188189
'current_usage' => {
189190
'@type' => 'v2_addon_usage',
190191
'@representation' => 'standard',
@@ -206,6 +207,7 @@
206207
'name' => 'Build Credits',
207208
'type' => 'credit_private',
208209
'recurring' => false,
210+
'free' => false,
209211
'current_usage' =>
210212
{
211213
'@type' => 'v2_addon_usage',

spec/v3/services/v2_subscriptions/create_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
'created_at': '2017-11-28T00:09:59.502Z',
160160
'updated_at': '2017-11-28T00:09:59.502Z',
161161
'current_usage_id': 7,
162+
'free': false,
162163
'current_usage': {
163164
'id': 7,
164165
'addon_id': 7,
@@ -309,6 +310,7 @@
309310
'name' => 'OSS Build Credits',
310311
'type' => 'credit_public',
311312
'recurring' => nil,
313+
'free' => false,
312314
'current_usage' => {
313315
'@type' => 'v2_addon_usage',
314316
'@representation' => 'standard',

0 commit comments

Comments
 (0)