lib/purecloudplatformclientv2/models/question.rb in purecloudplatformclientv2-24.0.0 vs lib/purecloudplatformclientv2/models/question.rb in purecloudplatformclientv2-25.0.0

- old
+ new

@@ -24,26 +24,29 @@ attr_accessor :help_text attr_accessor :type - attr_accessor :weight + attr_accessor :na_enabled - attr_accessor :na_required - attr_accessor :comments_required - attr_accessor :is_kill + attr_accessor :visibility_condition - attr_accessor :is_critical + # Options from which to choose an answer for this question. Only used by Multiple Choice type questions. + attr_accessor :answer_options - attr_accessor :na_enabled + # How many characters are allowed in the text response to this question. Used by NPS and Free Text question types. + attr_accessor :max_response_characters - attr_accessor :visibility_condition + # Prompt for details explaining the chosen NPS score. Used by NPS questions. + attr_accessor :explanation_prompt - attr_accessor :answer_options + attr_accessor :is_kill + attr_accessor :is_critical + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', @@ -52,26 +55,26 @@ :'help_text' => :'helpText', :'type' => :'type', - :'weight' => :'weight', + :'na_enabled' => :'naEnabled', - :'na_required' => :'naRequired', - :'comments_required' => :'commentsRequired', - :'is_kill' => :'isKill', + :'visibility_condition' => :'visibilityCondition', - :'is_critical' => :'isCritical', + :'answer_options' => :'answerOptions', - :'na_enabled' => :'naEnabled', + :'max_response_characters' => :'maxResponseCharacters', - :'visibility_condition' => :'visibilityCondition', + :'explanation_prompt' => :'explanationPrompt', - :'answer_options' => :'answerOptions' + :'is_kill' => :'isKill', + :'is_critical' => :'isCritical' + } end # Attribute type mapping. def self.swagger_types @@ -83,26 +86,26 @@ :'help_text' => :'String', :'type' => :'String', - :'weight' => :'Float', + :'na_enabled' => :'BOOLEAN', - :'na_required' => :'BOOLEAN', - :'comments_required' => :'BOOLEAN', - :'is_kill' => :'BOOLEAN', + :'visibility_condition' => :'VisibilityCondition', - :'is_critical' => :'BOOLEAN', + :'answer_options' => :'Array<AnswerOption>', - :'na_enabled' => :'BOOLEAN', + :'max_response_characters' => :'Integer', - :'visibility_condition' => :'VisibilityCondition', + :'explanation_prompt' => :'String', - :'answer_options' => :'Array<AnswerOption>' + :'is_kill' => :'BOOLEAN', + :'is_critical' => :'BOOLEAN' + } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -147,79 +150,79 @@ end - if attributes.has_key?(:'weight') + if attributes.has_key?(:'naEnabled') - self.weight = attributes[:'weight'] + self.na_enabled = attributes[:'naEnabled'] end - if attributes.has_key?(:'naRequired') + if attributes.has_key?(:'commentsRequired') - self.na_required = attributes[:'naRequired'] + self.comments_required = attributes[:'commentsRequired'] end - if attributes.has_key?(:'commentsRequired') + if attributes.has_key?(:'visibilityCondition') - self.comments_required = attributes[:'commentsRequired'] + self.visibility_condition = attributes[:'visibilityCondition'] end - if attributes.has_key?(:'isKill') + if attributes.has_key?(:'answerOptions') + if (value = attributes[:'answerOptions']).is_a?(Array) + self.answer_options = value + end - self.is_kill = attributes[:'isKill'] end - if attributes.has_key?(:'isCritical') + if attributes.has_key?(:'maxResponseCharacters') - self.is_critical = attributes[:'isCritical'] + self.max_response_characters = attributes[:'maxResponseCharacters'] end - if attributes.has_key?(:'naEnabled') + if attributes.has_key?(:'explanationPrompt') - self.na_enabled = attributes[:'naEnabled'] + self.explanation_prompt = attributes[:'explanationPrompt'] end - if attributes.has_key?(:'visibilityCondition') + if attributes.has_key?(:'isKill') - self.visibility_condition = attributes[:'visibilityCondition'] + self.is_kill = attributes[:'isKill'] end - if attributes.has_key?(:'answerOptions') + if attributes.has_key?(:'isCritical') - if (value = attributes[:'answerOptions']).is_a?(Array) - self.answer_options = value - end + self.is_critical = attributes[:'isCritical'] end @@ -250,10 +253,14 @@ + allowed_values = ["multipleChoiceQuestion", "freeTextQuestion", "npsQuestion", "readOnlyTextBlockQuestion"] + if @type && !allowed_values.include?(@type) + return false + end @@ -284,10 +291,11 @@ + end @@ -303,10 +311,20 @@ + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + allowed_values = ["multipleChoiceQuestion", "freeTextQuestion", "npsQuestion", "readOnlyTextBlockQuestion"] + if type && !allowed_values.include?(type) + fail ArgumentError, "invalid value for 'type', must be one of #{allowed_values}." + end + @type = type + end + @@ -346,28 +364,27 @@ - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && text == o.text && help_text == o.help_text && type == o.type && - weight == o.weight && - na_required == o.na_required && - comments_required == o.comments_required && - is_kill == o.is_kill && - is_critical == o.is_critical && na_enabled == o.na_enabled && + comments_required == o.comments_required && visibility_condition == o.visibility_condition && - answer_options == o.answer_options + answer_options == o.answer_options && + max_response_characters == o.max_response_characters && + explanation_prompt == o.explanation_prompt && + is_kill == o.is_kill && + is_critical == o.is_critical end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -375,10 +392,10 @@ end # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [id, text, help_text, type, weight, na_required, comments_required, is_kill, is_critical, na_enabled, visibility_condition, answer_options].hash + [id, text, help_text, type, na_enabled, comments_required, visibility_condition, answer_options, max_response_characters, explanation_prompt, is_kill, is_critical].hash end # build the object from hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash)