lib/bandwidth-sdk/models/create_call.rb in bandwidth-sdk-11.0.0.pre.beta.3.0 vs lib/bandwidth-sdk/models/create_call.rb in bandwidth-sdk-11.0.0.pre.beta.3.1

- old
+ new

@@ -4,11 +4,11 @@ #Bandwidth's Communication APIs The version of the OpenAPI document: 1.0.0 Contact: letstalk@bandwidth.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 7.0.0-SNAPSHOT +OpenAPI Generator version: 7.0.0 =end require 'date' require 'time' @@ -19,10 +19,13 @@ attr_accessor :to # A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`, or be one of the following strings: `Restricted`, `Anonymous`, `Private`, or `Unavailable`). attr_accessor :from + # The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. + attr_accessor :display_name + # A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. attr_accessor :uui # The id of the application associated with the `from` number. attr_accessor :application_id @@ -93,10 +96,11 @@ # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'to' => :'to', :'from' => :'from', + :'display_name' => :'displayName', :'uui' => :'uui', :'application_id' => :'applicationId', :'answer_url' => :'answerUrl', :'answer_method' => :'answerMethod', :'username' => :'username', @@ -123,10 +127,11 @@ # Attribute type mapping. def self.openapi_types { :'to' => :'String', :'from' => :'String', + :'display_name' => :'String', :'uui' => :'String', :'application_id' => :'String', :'answer_url' => :'String', :'answer_method' => :'CallbackMethodEnum', :'username' => :'String', @@ -146,10 +151,11 @@ end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'display_name', :'uui', :'answer_method', :'username', :'password', :'answer_fallback_url', @@ -190,10 +196,14 @@ self.from = attributes[:'from'] else self.from = nil end + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + if attributes.key?(:'uui') self.uui = attributes[:'uui'] end if attributes.key?(:'application_id') @@ -288,10 +298,14 @@ if @from.nil? invalid_properties.push('invalid value for "from", from cannot be nil.') end + if !@display_name.nil? && @display_name.to_s.length > 256 + invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 256.') + end + if @application_id.nil? invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') end if @answer_url.nil? @@ -361,10 +375,11 @@ # @return true if the model is valid def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @to.nil? return false if @from.nil? + return false if !@display_name.nil? && @display_name.to_s.length > 256 return false if @application_id.nil? return false if @answer_url.nil? return false if @answer_url.to_s.length > 2048 return false if !@username.nil? && @username.to_s.length > 1024 return false if !@password.nil? && @password.to_s.length > 1024 @@ -381,10 +396,20 @@ return false if !@tag.nil? && @tag.to_s.length > 256 true end # Custom attribute writer method with validation + # @param [Object] display_name Value to be assigned + def display_name=(display_name) + if !display_name.nil? && display_name.to_s.length > 256 + fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 256.' + end + + @display_name = display_name + end + + # Custom attribute writer method with validation # @param [Object] answer_url Value to be assigned def answer_url=(answer_url) if answer_url.nil? fail ArgumentError, 'answer_url cannot be nil' end @@ -513,10 +538,11 @@ def ==(o) return true if self.equal?(o) self.class == o.class && to == o.to && from == o.from && + display_name == o.display_name && uui == o.uui && application_id == o.application_id && answer_url == o.answer_url && answer_method == o.answer_method && username == o.username && @@ -541,10 +567,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [to, from, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash + [to, from, display_name, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself