lib/twilio-ruby/rest/api/v2010/account/call.rb in twilio-ruby-5.35.0 vs lib/twilio-ruby/rest/api/v2010/account/call.rb in twilio-ruby-5.36.0

- old
+ new

@@ -612,37 +612,37 @@ def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { - 'account_sid' => payload['account_sid'], - 'annotation' => payload['annotation'], - 'answered_by' => payload['answered_by'], - 'api_version' => payload['api_version'], - 'caller_name' => payload['caller_name'], + 'sid' => payload['sid'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), - 'direction' => payload['direction'], - 'duration' => payload['duration'], - 'end_time' => Twilio.deserialize_rfc2822(payload['end_time']), - 'forwarded_from' => payload['forwarded_from'], + 'parent_call_sid' => payload['parent_call_sid'], + 'account_sid' => payload['account_sid'], + 'to' => payload['to'], + 'to_formatted' => payload['to_formatted'], 'from' => payload['from'], 'from_formatted' => payload['from_formatted'], - 'group_sid' => payload['group_sid'], - 'parent_call_sid' => payload['parent_call_sid'], 'phone_number_sid' => payload['phone_number_sid'], + 'status' => payload['status'], + 'start_time' => Twilio.deserialize_rfc2822(payload['start_time']), + 'end_time' => Twilio.deserialize_rfc2822(payload['end_time']), + 'duration' => payload['duration'], 'price' => payload['price'], 'price_unit' => payload['price_unit'], - 'sid' => payload['sid'], - 'start_time' => Twilio.deserialize_rfc2822(payload['start_time']), - 'status' => payload['status'], - 'subresource_uris' => payload['subresource_uris'], - 'to' => payload['to'], - 'to_formatted' => payload['to_formatted'], + 'direction' => payload['direction'], + 'answered_by' => payload['answered_by'], + 'annotation' => payload['annotation'], + 'api_version' => payload['api_version'], + 'forwarded_from' => payload['forwarded_from'], + 'group_sid' => payload['group_sid'], + 'caller_name' => payload['caller_name'], + 'queue_time' => payload['queue_time'], 'trunk_sid' => payload['trunk_sid'], 'uri' => payload['uri'], - 'queue_time' => payload['queue_time'], + 'subresource_uris' => payload['subresource_uris'], } # Context @instance_context = nil @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } @@ -658,40 +658,16 @@ end @instance_context end ## - # @return [String] The SID of the Account that created this resource - def account_sid - @properties['account_sid'] + # @return [String] The unique string that identifies this resource + def sid + @properties['sid'] end ## - # @return [String] The annotation provided for the call - def annotation - @properties['annotation'] - end - - ## - # @return [String] Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise. - def answered_by - @properties['answered_by'] - end - - ## - # @return [String] The API Version used to create the call - def api_version - @properties['api_version'] - end - - ## - # @return [String] The caller's name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty. - def caller_name - @properties['caller_name'] - end - - ## # @return [Time] The RFC 2822 date and time in GMT that this resource was created def date_created @properties['date_created'] end @@ -700,31 +676,31 @@ def date_updated @properties['date_updated'] end ## - # @return [String] A string describing the direction of the call. `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `Dial` verb. - def direction - @properties['direction'] + # @return [String] The SID that identifies the call that created this leg. + def parent_call_sid + @properties['parent_call_sid'] end ## - # @return [String] The length of the call in seconds. - def duration - @properties['duration'] + # @return [String] The SID of the Account that created this resource + def account_sid + @properties['account_sid'] end ## - # @return [Time] The end time of the call. Null if the call did not complete successfully. - def end_time - @properties['end_time'] + # @return [String] The phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. + def to + @properties['to'] end ## - # @return [String] The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty. - def forwarded_from - @properties['forwarded_from'] + # @return [String] The phone number, SIP address or Client identifier that received this call. Formatted for display. + def to_formatted + @properties['to_formatted'] end ## # @return [String] The phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. def from @@ -736,28 +712,40 @@ def from_formatted @properties['from_formatted'] end ## - # @return [String] The Group SID associated with this call. If no Group is associated with the call, the field is empty. - def group_sid - @properties['group_sid'] + # @return [String] If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed. + def phone_number_sid + @properties['phone_number_sid'] end ## - # @return [String] The SID that identifies the call that created this leg. - def parent_call_sid - @properties['parent_call_sid'] + # @return [call.Status] The status of this call. + def status + @properties['status'] end ## - # @return [String] If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed. - def phone_number_sid - @properties['phone_number_sid'] + # @return [Time] The start time of the call. Null if the call has not yet been dialed. + def start_time + @properties['start_time'] end ## + # @return [Time] The end time of the call. Null if the call did not complete successfully. + def end_time + @properties['end_time'] + end + + ## + # @return [String] The length of the call in seconds. + def duration + @properties['duration'] + end + + ## # @return [String] The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. def price @properties['price'] end @@ -766,46 +754,58 @@ def price_unit @properties['price_unit'] end ## - # @return [String] The unique string that identifies this resource - def sid - @properties['sid'] + # @return [String] A string describing the direction of the call. `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `Dial` verb. + def direction + @properties['direction'] end ## - # @return [Time] The start time of the call. Null if the call has not yet been dialed. - def start_time - @properties['start_time'] + # @return [String] Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise. + def answered_by + @properties['answered_by'] end ## - # @return [call.Status] The status of this call. - def status - @properties['status'] + # @return [String] The annotation provided for the call + def annotation + @properties['annotation'] end ## - # @return [String] A list of related subresources identified by their relative URIs - def subresource_uris - @properties['subresource_uris'] + # @return [String] The API Version used to create the call + def api_version + @properties['api_version'] end ## - # @return [String] The phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. - def to - @properties['to'] + # @return [String] The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty. + def forwarded_from + @properties['forwarded_from'] end ## - # @return [String] The phone number, SIP address or Client identifier that received this call. Formatted for display. - def to_formatted - @properties['to_formatted'] + # @return [String] The Group SID associated with this call. If no Group is associated with the call, the field is empty. + def group_sid + @properties['group_sid'] end ## + # @return [String] The caller's name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty. + def caller_name + @properties['caller_name'] + end + + ## + # @return [String] The wait time in milliseconds before the call is placed. + def queue_time + @properties['queue_time'] + end + + ## # @return [String] The (optional) unique identifier of the trunk resource that was used for this call. def trunk_sid @properties['trunk_sid'] end @@ -814,12 +814,12 @@ def uri @properties['uri'] end ## - # @return [String] The wait time in milliseconds before the call is placed. - def queue_time - @properties['queue_time'] + # @return [String] A list of related subresources identified by their relative URIs + def subresource_uris + @properties['subresource_uris'] end ## # Deletes the CallInstance # @return [Boolean] true if delete succeeds, false otherwise \ No newline at end of file