@@ -41,6 +41,7 @@ class CallAttempt
customer_id String
from String
to(/\A\+\d+\Z/)
+ sgx Blather::JID
call_id String
direction Either(:inbound, :outbound)
limit_remaining Integer
@@ -60,13 +61,7 @@ class CallAttempt
end
def as_json(*)
- {
- from: from,
- to: to,
- customer_id: customer_id,
- limit_remaining: limit_remaining,
- max_minutes: max_minutes
- }
+ to_h
end
def to_json(*args)
@@ -78,7 +73,7 @@ class CallAttempt
if rate&.zero?
new(
**kwargs
- .merge(customer_id: customer.customer_id)
+ .merge(customer_id: customer.customer_id, sgx: customer.sgx)
.slice(*value_semantics.attributes.map(&:name))
)
end
@@ -88,6 +83,7 @@ class CallAttempt
customer_id String
from String
to(/\A\+\d+\Z/)
+ sgx Blather::JID
call_id String
direction Either(:inbound, :outbound)
end
@@ -105,11 +101,7 @@ class CallAttempt
end
def as_json(*)
- {
- from: from,
- to: to,
- customer_id: customer_id
- }.compact
+ to_h
end
def to_json(*args)
@@ -302,7 +294,7 @@ class CallAttempt
register do |customer:, **kwargs|
new(
**kwargs
- .merge(customer_id: customer.customer_id)
+ .merge(customer_id: customer.customer_id, sgx: customer.sgx)
.slice(*value_semantics.attributes.map(&:name))
)
end