Class: SparteraApiSdk::PostsUpdate
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- SparteraApiSdk::PostsUpdate
- Defined in:
- lib/spartera_api_sdk/models/posts_update.rb
Overview
Update schema for modifying Post
Instance Attribute Summary collapse
-
#category ⇒ Object
Article category (e.g., ‘Sports’, ‘Business’).
-
#company_id ⇒ Object
Company this post belongs to.
-
#content_html ⇒ Object
Generated article HTML content.
-
#data_cost_credits ⇒ Object
Cost in credits for data insights.
-
#failed_insights_count ⇒ Object
Number of insights that failed.
-
#generation_creativity ⇒ Object
Creativity level (0-100), maps to AI temperature.
-
#generation_include_citations ⇒ Object
Whether to include data source citations.
-
#generation_subheading_count ⇒ Object
Number of subheadings (2-5).
-
#generation_target_word_count ⇒ Object
Target word count (null = auto).
-
#generation_temperature ⇒ Object
Actual temperature used for generation (0.0-2.0).
-
#generation_time_ms ⇒ Object
Time taken to generate article in milliseconds.
-
#generation_tone ⇒ Object
Writing tone: professional, casual, technical, conversational.
-
#insights_used ⇒ Object
Array of insights used: [asset_name, value, runtime, success].
-
#is_published ⇒ Object
Whether this post has been published.
-
#last_edited_at ⇒ Object
When this post was last edited.
-
#published_at ⇒ Object
When this post was published.
-
#service_cost_credits ⇒ Object
Cost in credits for AI generation service.
-
#successful_insights_count ⇒ Object
Number of insights that succeeded.
-
#teaser ⇒ Object
Article teaser/subtitle.
-
#title ⇒ Object
Article title.
-
#total_cost_credits ⇒ Object
Total cost in credits (data + service).
-
#user_id ⇒ Object
User who created this post.
-
#view_count ⇒ Object
Number of times this post has been viewed.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PostsUpdate
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ PostsUpdate
Initializes the object
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 164 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SparteraApiSdk::PostsUpdate` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `SparteraApiSdk::PostsUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] end if attributes.key?(:'company_id') self.company_id = attributes[:'company_id'] end if attributes.key?(:'title') self.title = attributes[:'title'] end if attributes.key?(:'category') self.category = attributes[:'category'] end if attributes.key?(:'teaser') self. = attributes[:'teaser'] end if attributes.key?(:'content_html') self.content_html = attributes[:'content_html'] end if attributes.key?(:'insights_used') self.insights_used = attributes[:'insights_used'] end if attributes.key?(:'generation_creativity') self.generation_creativity = attributes[:'generation_creativity'] end if attributes.key?(:'generation_target_word_count') self.generation_target_word_count = attributes[:'generation_target_word_count'] end if attributes.key?(:'generation_tone') self.generation_tone = attributes[:'generation_tone'] end if attributes.key?(:'generation_include_citations') self.generation_include_citations = attributes[:'generation_include_citations'] end if attributes.key?(:'generation_subheading_count') self.generation_subheading_count = attributes[:'generation_subheading_count'] end if attributes.key?(:'generation_temperature') self.generation_temperature = attributes[:'generation_temperature'] end if attributes.key?(:'data_cost_credits') self.data_cost_credits = attributes[:'data_cost_credits'] end if attributes.key?(:'service_cost_credits') self.service_cost_credits = attributes[:'service_cost_credits'] end if attributes.key?(:'total_cost_credits') self.total_cost_credits = attributes[:'total_cost_credits'] end if attributes.key?(:'successful_insights_count') self.successful_insights_count = attributes[:'successful_insights_count'] end if attributes.key?(:'failed_insights_count') self.failed_insights_count = attributes[:'failed_insights_count'] end if attributes.key?(:'generation_time_ms') self.generation_time_ms = attributes[:'generation_time_ms'] end if attributes.key?(:'is_published') self.is_published = attributes[:'is_published'] end if attributes.key?(:'published_at') self.published_at = attributes[:'published_at'] end if attributes.key?(:'view_count') self.view_count = attributes[:'view_count'] end if attributes.key?(:'last_edited_at') self.last_edited_at = attributes[:'last_edited_at'] end end |
Instance Attribute Details
#category ⇒ Object
Article category (e.g., ‘Sports’, ‘Business’)
29 30 31 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 29 def category @category end |
#company_id ⇒ Object
Company this post belongs to
23 24 25 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 23 def company_id @company_id end |
#content_html ⇒ Object
Generated article HTML content
35 36 37 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 35 def content_html @content_html end |
#data_cost_credits ⇒ Object
Cost in credits for data insights
59 60 61 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 59 def data_cost_credits @data_cost_credits end |
#failed_insights_count ⇒ Object
Number of insights that failed
71 72 73 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 71 def failed_insights_count @failed_insights_count end |
#generation_creativity ⇒ Object
Creativity level (0-100), maps to AI temperature
41 42 43 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 41 def generation_creativity @generation_creativity end |
#generation_include_citations ⇒ Object
Whether to include data source citations
50 51 52 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 50 def generation_include_citations @generation_include_citations end |
#generation_subheading_count ⇒ Object
Number of subheadings (2-5)
53 54 55 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 53 def generation_subheading_count @generation_subheading_count end |
#generation_target_word_count ⇒ Object
Target word count (null = auto)
44 45 46 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 44 def generation_target_word_count @generation_target_word_count end |
#generation_temperature ⇒ Object
Actual temperature used for generation (0.0-2.0)
56 57 58 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 56 def generation_temperature @generation_temperature end |
#generation_time_ms ⇒ Object
Time taken to generate article in milliseconds
74 75 76 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 74 def generation_time_ms @generation_time_ms end |
#generation_tone ⇒ Object
Writing tone: professional, casual, technical, conversational
47 48 49 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 47 def generation_tone @generation_tone end |
#insights_used ⇒ Object
Array of insights used: [asset_name, value, runtime, success]
38 39 40 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 38 def insights_used @insights_used end |
#is_published ⇒ Object
Whether this post has been published
77 78 79 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 77 def is_published @is_published end |
#last_edited_at ⇒ Object
When this post was last edited
86 87 88 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 86 def last_edited_at @last_edited_at end |
#published_at ⇒ Object
When this post was published
80 81 82 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 80 def published_at @published_at end |
#service_cost_credits ⇒ Object
Cost in credits for AI generation service
62 63 64 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 62 def service_cost_credits @service_cost_credits end |
#successful_insights_count ⇒ Object
Number of insights that succeeded
68 69 70 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 68 def successful_insights_count @successful_insights_count end |
#teaser ⇒ Object
Article teaser/subtitle
32 33 34 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 32 def @teaser end |
#title ⇒ Object
Article title
26 27 28 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 26 def title @title end |
#total_cost_credits ⇒ Object
Total cost in credits (data + service)
65 66 67 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 65 def total_cost_credits @total_cost_credits end |
#user_id ⇒ Object
User who created this post
20 21 22 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 20 def user_id @user_id end |
#view_count ⇒ Object
Number of times this post has been viewed
83 84 85 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 83 def view_count @view_count end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
118 119 120 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 118 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
123 124 125 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 123 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 89 def self.attribute_map { :'user_id' => :'user_id', :'company_id' => :'company_id', :'title' => :'title', :'category' => :'category', :'teaser' => :'teaser', :'content_html' => :'content_html', :'insights_used' => :'insights_used', :'generation_creativity' => :'generation_creativity', :'generation_target_word_count' => :'generation_target_word_count', :'generation_tone' => :'generation_tone', :'generation_include_citations' => :'generation_include_citations', :'generation_subheading_count' => :'generation_subheading_count', :'generation_temperature' => :'generation_temperature', :'data_cost_credits' => :'data_cost_credits', :'service_cost_credits' => :'service_cost_credits', :'total_cost_credits' => :'total_cost_credits', :'successful_insights_count' => :'successful_insights_count', :'failed_insights_count' => :'failed_insights_count', :'generation_time_ms' => :'generation_time_ms', :'is_published' => :'is_published', :'published_at' => :'published_at', :'view_count' => :'view_count', :'last_edited_at' => :'last_edited_at' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 331 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
157 158 159 160 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 157 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 128 def self.openapi_types { :'user_id' => :'String', :'company_id' => :'String', :'title' => :'String', :'category' => :'String', :'teaser' => :'String', :'content_html' => :'String', :'insights_used' => :'Object', :'generation_creativity' => :'Integer', :'generation_target_word_count' => :'Integer', :'generation_tone' => :'String', :'generation_include_citations' => :'Boolean', :'generation_subheading_count' => :'Integer', :'generation_temperature' => :'Float', :'data_cost_credits' => :'Integer', :'service_cost_credits' => :'Integer', :'total_cost_credits' => :'Integer', :'successful_insights_count' => :'Integer', :'failed_insights_count' => :'Integer', :'generation_time_ms' => :'Integer', :'is_published' => :'Boolean', :'published_at' => :'Time', :'view_count' => :'Integer', :'last_edited_at' => :'Time' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 288 def ==(o) return true if self.equal?(o) self.class == o.class && user_id == o.user_id && company_id == o.company_id && title == o.title && category == o.category && == o. && content_html == o.content_html && insights_used == o.insights_used && generation_creativity == o.generation_creativity && generation_target_word_count == o.generation_target_word_count && generation_tone == o.generation_tone && generation_include_citations == o.generation_include_citations && generation_subheading_count == o.generation_subheading_count && generation_temperature == o.generation_temperature && data_cost_credits == o.data_cost_credits && service_cost_credits == o.service_cost_credits && total_cost_credits == o.total_cost_credits && successful_insights_count == o.successful_insights_count && failed_insights_count == o.failed_insights_count && generation_time_ms == o.generation_time_ms && is_published == o.is_published && published_at == o.published_at && view_count == o.view_count && last_edited_at == o.last_edited_at end |
#eql?(o) ⇒ Boolean
318 319 320 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 318 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
324 325 326 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 324 def hash [user_id, company_id, title, category, , content_html, insights_used, generation_creativity, generation_target_word_count, generation_tone, generation_include_citations, generation_subheading_count, generation_temperature, data_cost_credits, service_cost_credits, total_cost_credits, successful_insights_count, failed_insights_count, generation_time_ms, is_published, published_at, view_count, last_edited_at].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
273 274 275 276 277 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 273 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 353 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
281 282 283 284 |
# File 'lib/spartera_api_sdk/models/posts_update.rb', line 281 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |