lib/intrinio-sdk/models/company_news.rb in intrinio-sdk-6.27.0 vs lib/intrinio-sdk/models/company_news.rb in intrinio-sdk-6.27.1

- old
+ new

@@ -1,11 +1,11 @@ =begin #Intrinio API #Welcome to the Intrinio API! Through our Financial Data Marketplace, we offer a wide selection of financial data feed APIs sourced by our own proprietary processes as well as from many data vendors. For a complete API request / response reference please view the [Intrinio API documentation](https://docs.intrinio.com/documentation/api_v2). If you need additional help in using the API, please visit the [Intrinio website](https://intrinio.com) and click on the chat icon in the lower right corner. -OpenAPI spec version: 2.53.1 +OpenAPI spec version: 2.56.5 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: unset =end @@ -28,23 +28,79 @@ attr_accessor :url # A summary of the news article attr_accessor :summary + # The news source. + attr_accessor :source + # The Company to which the new article pertains attr_accessor :company + attr_accessor :topics + # The copyright of the news article + attr_accessor :copyright + + # The language code of the news article + attr_accessor :language + + # The word count of the news article + attr_accessor :word_count + + # Whether the news article is marked as spam or not + attr_accessor :spam + + # How strongly correlated the news article is to the business + attr_accessor :business_relevance + + # The news sentiment. + attr_accessor :article_sentiment + + # The confidence score of the sentiment rating + attr_accessor :article_sentiment_confidence + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', :'title' => :'title', :'publication_date' => :'publication_date', :'url' => :'url', :'summary' => :'summary', - :'company' => :'company' + :'source' => :'source', + :'company' => :'company', + :'topics' => :'topics', + :'copyright' => :'copyright', + :'language' => :'language', + :'word_count' => :'word_count', + :'spam' => :'spam', + :'business_relevance' => :'business_relevance', + :'article_sentiment' => :'article_sentiment', + :'article_sentiment_confidence' => :'article_sentiment_confidence' } end # Attribute type mapping. def self.swagger_types @@ -52,11 +108,20 @@ :'id' => :'String', :'title' => :'String', :'publication_date' => :'DateTime', :'url' => :'String', :'summary' => :'String', - :'company' => :'CompanySummary' + :'source' => :'String', + :'company' => :'CompanySummary', + :'topics' => :'Array<NewsTopic>', + :'copyright' => :'String', + :'language' => :'String', + :'word_count' => :'Integer', + :'spam' => :'BOOLEAN', + :'business_relevance' => :'Float', + :'article_sentiment' => :'String', + :'article_sentiment_confidence' => :'Float' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -84,14 +149,52 @@ if attributes.has_key?(:'summary') self.summary = attributes[:'summary'] end + if attributes.has_key?(:'source') + self.source = attributes[:'source'] + end + if attributes.has_key?(:'company') self.company = attributes[:'company'] end + if attributes.has_key?(:'topics') + if (value = attributes[:'topics']).is_a?(Array) + self.topics = value + end + end + + if attributes.has_key?(:'copyright') + self.copyright = attributes[:'copyright'] + end + + if attributes.has_key?(:'language') + self.language = attributes[:'language'] + end + + if attributes.has_key?(:'word_count') + self.word_count = attributes[:'word_count'] + end + + if attributes.has_key?(:'spam') + self.spam = attributes[:'spam'] + end + + if attributes.has_key?(:'business_relevance') + self.business_relevance = attributes[:'business_relevance'] + end + + if attributes.has_key?(:'article_sentiment') + self.article_sentiment = attributes[:'article_sentiment'] + end + + if attributes.has_key?(:'article_sentiment_confidence') + self.article_sentiment_confidence = attributes[:'article_sentiment_confidence'] + end + end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties @@ -100,24 +203,57 @@ end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + source_validator = EnumAttributeValidator.new('String', ["yahoo", "moody", "moody_us_news", "moody_us_press_releases"]) + return false unless source_validator.valid?(@source) + article_sentiment_validator = EnumAttributeValidator.new('String', ["positive", "neutral", "negative"]) + return false unless article_sentiment_validator.valid?(@article_sentiment) return true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] source Object to be assigned + def source=(source) + validator = EnumAttributeValidator.new('String', ["yahoo", "moody", "moody_us_news", "moody_us_press_releases"]) + unless validator.valid?(source) + fail ArgumentError, "invalid value for 'source', must be one of #{validator.allowable_values}." + end + @source = source + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] article_sentiment Object to be assigned + def article_sentiment=(article_sentiment) + validator = EnumAttributeValidator.new('String', ["positive", "neutral", "negative"]) + unless validator.valid?(article_sentiment) + fail ArgumentError, "invalid value for 'article_sentiment', must be one of #{validator.allowable_values}." + end + @article_sentiment = article_sentiment + end + # 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 && title == o.title && publication_date == o.publication_date && url == o.url && summary == o.summary && - company == o.company + source == o.source && + company == o.company && + topics == o.topics && + copyright == o.copyright && + language == o.language && + word_count == o.word_count && + spam == o.spam && + business_relevance == o.business_relevance && + article_sentiment == o.article_sentiment && + article_sentiment_confidence == o.article_sentiment_confidence end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -125,10 +261,10 @@ end # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [id, title, publication_date, url, summary, company].hash + [id, title, publication_date, url, summary, source, company, topics, copyright, language, word_count, spam, business_relevance, article_sentiment, article_sentiment_confidence].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself