Class: Hubspot::Cms::Blogs::BlogPosts::BlogPost

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BlogPost

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 353

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Cms::Blogs::BlogPosts::BlogPost` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Cms::Blogs::BlogPosts::BlogPost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'slug')
    self.slug = attributes[:'slug']
  end

  if attributes.key?(:'content_group_id')
    self.content_group_id = attributes[:'content_group_id']
  end

  if attributes.key?(:'campaign')
    self.campaign = attributes[:'campaign']
  end

  if attributes.key?(:'category_id')
    self.category_id = attributes[:'category_id']
  end

  if attributes.key?(:'state')
    self.state = attributes[:'state']
  end

  if attributes.key?(:'template_path')
    self.template_path = attributes[:'template_path']
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'mab_experiment_id')
    self.mab_experiment_id = attributes[:'mab_experiment_id']
  end

  if attributes.key?(:'archived')
    self.archived = attributes[:'archived']
  end

  if attributes.key?(:'author_name')
    self.author_name = attributes[:'author_name']
  end

  if attributes.key?(:'ab_test_id')
    self.ab_test_id = attributes[:'ab_test_id']
  end

  if attributes.key?(:'created_by_id')
    self.created_by_id = attributes[:'created_by_id']
  end

  if attributes.key?(:'updated_by_id')
    self.updated_by_id = attributes[:'updated_by_id']
  end

  if attributes.key?(:'domain')
    self.domain = attributes[:'domain']
  end

  if attributes.key?(:'subcategory')
    self.subcategory = attributes[:'subcategory']
  end

  if attributes.key?(:'ab_status')
    self.ab_status = attributes[:'ab_status']
  end

  if attributes.key?(:'folder_id')
    self.folder_id = attributes[:'folder_id']
  end

  if attributes.key?(:'widget_containers')
    self.widget_containers = attributes[:'widget_containers']
  end

  if attributes.key?(:'widgets')
    self.widgets = attributes[:'widgets']
  end

  if attributes.key?(:'language')
    self.language = attributes[:'language']
  end

  if attributes.key?(:'translated_from_id')
    self.translated_from_id = attributes[:'translated_from_id']
  end

  if attributes.key?(:'dynamic_page_hub_db_table_id')
    self.dynamic_page_hub_db_table_id = attributes[:'dynamic_page_hub_db_table_id']
  end

  if attributes.key?(:'blog_author_id')
    self.blog_author_id = attributes[:'blog_author_id']
  end

  if attributes.key?(:'html_title')
    self.html_title = attributes[:'html_title']
  end

  if attributes.key?(:'page_redirected')
    self.page_redirected = attributes[:'page_redirected']
  end

  if attributes.key?(:'page_expiry_enabled')
    self.page_expiry_enabled = attributes[:'page_expiry_enabled']
  end

  if attributes.key?(:'page_expiry_date')
    self.page_expiry_date = attributes[:'page_expiry_date']
  end

  if attributes.key?(:'page_expiry_redirect_id')
    self.page_expiry_redirect_id = attributes[:'page_expiry_redirect_id']
  end

  if attributes.key?(:'page_expiry_redirect_url')
    self.page_expiry_redirect_url = attributes[:'page_expiry_redirect_url']
  end

  if attributes.key?(:'use_featured_image')
    self.use_featured_image = attributes[:'use_featured_image']
  end

  if attributes.key?(:'tag_ids')
    if (value = attributes[:'tag_ids']).is_a?(Array)
      self.tag_ids = value
    end
  end

  if attributes.key?(:'enable_google_amp_output_override')
    self.enable_google_amp_output_override = attributes[:'enable_google_amp_output_override']
  end

  if attributes.key?(:'_post_body')
    self._post_body = attributes[:'_post_body']
  end

  if attributes.key?(:'post_summary')
    self.post_summary = attributes[:'post_summary']
  end

  if attributes.key?(:'rss_body')
    self.rss_body = attributes[:'rss_body']
  end

  if attributes.key?(:'rss_summary')
    self.rss_summary = attributes[:'rss_summary']
  end

  if attributes.key?(:'password')
    self.password = attributes[:'password']
  end

  if attributes.key?(:'attached_stylesheets')
    if (value = attributes[:'attached_stylesheets']).is_a?(Array)
      self.attached_stylesheets = value
    end
  end

  if attributes.key?(:'include_default_custom_css')
    self.include_default_custom_css = attributes[:'include_default_custom_css']
  end

  if attributes.key?(:'enable_domain_stylesheets')
    self.enable_domain_stylesheets = attributes[:'enable_domain_stylesheets']
  end

  if attributes.key?(:'enable_layout_stylesheets')
    self.enable_layout_stylesheets = attributes[:'enable_layout_stylesheets']
  end

  if attributes.key?(:'meta_description')
    self.meta_description = attributes[:'meta_description']
  end

  if attributes.key?(:'publish_immediately')
    self.publish_immediately = attributes[:'publish_immediately']
  end

  if attributes.key?(:'head_html')
    self.head_html = attributes[:'head_html']
  end

  if attributes.key?(:'footer_html')
    self.footer_html = attributes[:'footer_html']
  end

  if attributes.key?(:'content_type_category')
    self.content_type_category = attributes[:'content_type_category']
  end

  if attributes.key?(:'current_state')
    self.current_state = attributes[:'current_state']
  end

  if attributes.key?(:'link_rel_canonical_url')
    self.link_rel_canonical_url = attributes[:'link_rel_canonical_url']
  end

  if attributes.key?(:'featured_image')
    self.featured_image = attributes[:'featured_image']
  end

  if attributes.key?(:'featured_image_alt_text')
    self.featured_image_alt_text = attributes[:'featured_image_alt_text']
  end

  if attributes.key?(:'public_access_rules_enabled')
    self.public_access_rules_enabled = attributes[:'public_access_rules_enabled']
  end

  if attributes.key?(:'public_access_rules')
    if (value = attributes[:'public_access_rules']).is_a?(Array)
      self.public_access_rules = value
    end
  end

  if attributes.key?(:'layout_sections')
    if (value = attributes[:'layout_sections']).is_a?(Hash)
      self.layout_sections = value
    end
  end

  if attributes.key?(:'theme_settings_values')
    self.theme_settings_values = attributes[:'theme_settings_values']
  end

  if attributes.key?(:'url')
    self.url = attributes[:'url']
  end

  if attributes.key?(:'publish_date')
    self.publish_date = attributes[:'publish_date']
  end

  if attributes.key?(:'deleted_at')
    self.deleted_at = attributes[:'deleted_at']
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.key?(:'published')
    self.published = attributes[:'published']
  end

  if attributes.key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  end
end

Instance Attribute Details

#_post_bodyObject

The HTML of the main post body.



108
109
110
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 108

def _post_body
  @_post_body
end

#ab_statusObject

Returns the value of attribute ab_status.



64
65
66
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 64

def ab_status
  @ab_status
end

#ab_test_idObject

Returns the value of attribute ab_test_id.



51
52
53
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 51

def ab_test_id
  @ab_test_id
end

#archivedObject

If True, the post will not show up in your dashboard, although the post could still be live.



46
47
48
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 46

def archived
  @archived
end

#attached_stylesheetsObject

List of stylesheets to attach to this blog post. These stylesheets are attached to just this page. Order of precedence is bottom to top, just like in the HTML.



123
124
125
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 123

def attached_stylesheets
  @attached_stylesheets
end

#author_nameObject

The name of the user that updated this blog post.



49
50
51
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 49

def author_name
  @author_name
end

#blog_author_idObject

The ID of the Blog Author associated with this Blog Post.



83
84
85
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 83

def blog_author_id
  @blog_author_id
end

#campaignObject

The GUID of the marketing campaign this Blog Post is a part of.



30
31
32
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 30

def campaign
  @campaign
end

#category_idObject

ID of the type of object this is. Should always .



33
34
35
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 33

def category_id
  @category_id
end

#content_group_idObject

The ID of the parent Blog this Blog Post is associated with.



27
28
29
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 27

def content_group_id
  @content_group_id
end

#content_type_categoryObject

An ENUM descibing the type of this object. Should always be BLOG_POST.



147
148
149
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 147

def content_type_category
  @content_type_category
end

#created_atObject

The timestamp (ISO8601 format) when this blog post was created.



181
182
183
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 181

def created_at
  @created_at
end

#created_by_idObject

The ID of the user that created this blog post.



54
55
56
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 54

def created_by_id
  @created_by_id
end

#current_stateObject

A generated ENUM descibing the current state of this Blog Post. Should always match state.



150
151
152
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 150

def current_state
  @current_state
end

#deleted_atObject

The timestamp (ISO8601 format) when this Blog Post was deleted.



178
179
180
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 178

def deleted_at
  @deleted_at
end

#domainObject

The domain this Blog Post will resolve to. If null, the Blog Post will default to the domain of the ParentBlog.



60
61
62
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 60

def domain
  @domain
end

#dynamic_page_hub_db_table_idObject

Returns the value of attribute dynamic_page_hub_db_table_id.



80
81
82
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 80

def dynamic_page_hub_db_table_id
  @dynamic_page_hub_db_table_id
end

#enable_domain_stylesheetsObject

Boolean to determine whether or not the styles from the template should be applied.



129
130
131
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 129

def enable_domain_stylesheets
  @enable_domain_stylesheets
end

#enable_google_amp_output_overrideObject

Boolean to allow overriding the AMP settings for the blog.



105
106
107
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 105

def enable_google_amp_output_override
  @enable_google_amp_output_override
end

#enable_layout_stylesheetsObject

Boolean to determine whether or not the styles from the template should be applied.



132
133
134
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 132

def enable_layout_stylesheets
  @enable_layout_stylesheets
end

The featuredImage of this Blog Post.



156
157
158
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 156

def featured_image
  @featured_image
end

Alt Text of the featuredImage.



159
160
161
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 159

def featured_image_alt_text
  @featured_image_alt_text
end

#folder_idObject

Returns the value of attribute folder_id.



66
67
68
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 66

def folder_id
  @folder_id
end

Custom HTML for embed codes, javascript that should be placed before the </body> tag of the page.



144
145
146
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 144

def footer_html
  @footer_html
end

#head_htmlObject

Custom HTML for embed codes, javascript, etc. that goes in the <head> tag of the page.



141
142
143
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 141

def head_html
  @head_html
end

#html_titleObject

The html title of this Blog Post.



86
87
88
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 86

def html_title
  @html_title
end

#idObject

The unique ID of the Blog Post.



21
22
23
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 21

def id
  @id
end

#include_default_custom_cssObject

Boolean to determine whether or not the Primary CSS Files should be applied.



126
127
128
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 126

def include_default_custom_css
  @include_default_custom_css
end

#languageObject

The explicitly defined language of the Blog Post. If null, the Blog Post will default to the language of the ParentBlog.



75
76
77
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 75

def language
  @language
end

#layout_sectionsObject

Returns the value of attribute layout_sections.



167
168
169
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 167

def layout_sections
  @layout_sections
end

Optional override to set the URL to be used in the rel=canonical link tag on the page.



153
154
155
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 153

def link_rel_canonical_url
  @link_rel_canonical_url
end

#mab_experiment_idObject

Returns the value of attribute mab_experiment_id.



43
44
45
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 43

def mab_experiment_id
  @mab_experiment_id
end

#meta_descriptionObject

A description that goes in <meta> tag on the page.



135
136
137
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 135

def meta_description
  @meta_description
end

#nameObject

The internal name of the blog post.



41
42
43
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 41

def name
  @name
end

#page_expiry_dateObject

Returns the value of attribute page_expiry_date.



92
93
94
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 92

def page_expiry_date
  @page_expiry_date
end

#page_expiry_enabledObject

Returns the value of attribute page_expiry_enabled.



90
91
92
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 90

def page_expiry_enabled
  @page_expiry_enabled
end

#page_expiry_redirect_idObject

Returns the value of attribute page_expiry_redirect_id.



94
95
96
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 94

def page_expiry_redirect_id
  @page_expiry_redirect_id
end

#page_expiry_redirect_urlObject

Returns the value of attribute page_expiry_redirect_url.



96
97
98
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 96

def page_expiry_redirect_url
  @page_expiry_redirect_url
end

#page_redirectedObject

Returns the value of attribute page_redirected.



88
89
90
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 88

def page_redirected
  @page_redirected
end

#passwordObject

Set this to create a password protected page. Entering the password will be required to view the page.



120
121
122
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 120

def password
  @password
end

#post_summaryObject

The summary of the blog post that will appear on the main listing page.



111
112
113
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 111

def post_summary
  @post_summary
end

#public_access_rulesObject

Rules for require member registration to access private content.



165
166
167
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 165

def public_access_rules
  @public_access_rules
end

#public_access_rules_enabledObject

Boolean to determine whether or not to respect publicAccessRules.



162
163
164
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 162

def public_access_rules_enabled
  @public_access_rules_enabled
end

#publish_dateObject

The date (ISO8601 format) the blog post is to be published at.



175
176
177
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 175

def publish_date
  @publish_date
end

#publish_immediatelyObject

Set this to true if you want to be published immediately when the schedule publish endpoint is called, and to ignore the publish_date setting.



138
139
140
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 138

def publish_immediately
  @publish_immediately
end

#publishedObject

Boolean describing if this Blog Post is published.



184
185
186
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 184

def published
  @published
end

#rss_bodyObject

The contents of the RSS body for this Blog Post.



114
115
116
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 114

def rss_body
  @rss_body
end

#rss_summaryObject

The contents of the RSS summary for this Blog Post.



117
118
119
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 117

def rss_summary
  @rss_summary
end

#slugObject

The path of the this blog post. This field is appended to the domain to construct the url of this post.



24
25
26
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 24

def slug
  @slug
end

#stateObject

An ENUM descibing the current state of this Blog Post.



36
37
38
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 36

def state
  @state
end

#subcategoryObject

Returns the value of attribute subcategory.



62
63
64
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 62

def subcategory
  @subcategory
end

#tag_idsObject

List of IDs for the tags associated with this Blog Post.



102
103
104
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 102

def tag_ids
  @tag_ids
end

#template_pathObject

Returns the value of attribute template_path.



38
39
40
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 38

def template_path
  @template_path
end

#theme_settings_valuesObject

Returns the value of attribute theme_settings_values.



169
170
171
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 169

def theme_settings_values
  @theme_settings_values
end

#translated_from_idObject

ID of the primary blog post this object was translated from.



78
79
80
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 78

def translated_from_id
  @translated_from_id
end

#updated_atObject

The timestamp (ISO8601 format) when this Blog Post was last updated.



187
188
189
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 187

def updated_at
  @updated_at
end

#updated_by_idObject

The ID of the user that updated this blog post.



57
58
59
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 57

def updated_by_id
  @updated_by_id
end

#urlObject

A generated field representing the URL of this blog post.



172
173
174
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 172

def url
  @url
end

Boolean to determine if this post should use a featuredImage.



99
100
101
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 99

def use_featured_image
  @use_featured_image
end

#widget_containersObject

A data structure containing the data for all the modules inside the containers for this post. This will only be populated if the page has widget containers.



69
70
71
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 69

def widget_containers
  @widget_containers
end

#widgetsObject

A data structure containing the data for all the modules for this page.



72
73
74
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 72

def widgets
  @widgets
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



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
270
271
272
273
274
275
276
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 212

def self.attribute_map
  {
    :'id' => :'id',
    :'slug' => :'slug',
    :'content_group_id' => :'contentGroupId',
    :'campaign' => :'campaign',
    :'category_id' => :'categoryId',
    :'state' => :'state',
    :'template_path' => :'templatePath',
    :'name' => :'name',
    :'mab_experiment_id' => :'mabExperimentId',
    :'archived' => :'archived',
    :'author_name' => :'authorName',
    :'ab_test_id' => :'abTestId',
    :'created_by_id' => :'createdById',
    :'updated_by_id' => :'updatedById',
    :'domain' => :'domain',
    :'subcategory' => :'subcategory',
    :'ab_status' => :'abStatus',
    :'folder_id' => :'folderId',
    :'widget_containers' => :'widgetContainers',
    :'widgets' => :'widgets',
    :'language' => :'language',
    :'translated_from_id' => :'translatedFromId',
    :'dynamic_page_hub_db_table_id' => :'dynamicPageHubDbTableId',
    :'blog_author_id' => :'blogAuthorId',
    :'html_title' => :'htmlTitle',
    :'page_redirected' => :'pageRedirected',
    :'page_expiry_enabled' => :'pageExpiryEnabled',
    :'page_expiry_date' => :'pageExpiryDate',
    :'page_expiry_redirect_id' => :'pageExpiryRedirectId',
    :'page_expiry_redirect_url' => :'pageExpiryRedirectUrl',
    :'use_featured_image' => :'useFeaturedImage',
    :'tag_ids' => :'tagIds',
    :'enable_google_amp_output_override' => :'enableGoogleAmpOutputOverride',
    :'_post_body' => :'postBody',
    :'post_summary' => :'postSummary',
    :'rss_body' => :'rssBody',
    :'rss_summary' => :'rssSummary',
    :'password' => :'password',
    :'attached_stylesheets' => :'attachedStylesheets',
    :'include_default_custom_css' => :'includeDefaultCustomCss',
    :'enable_domain_stylesheets' => :'enableDomainStylesheets',
    :'enable_layout_stylesheets' => :'enableLayoutStylesheets',
    :'meta_description' => :'metaDescription',
    :'publish_immediately' => :'publishImmediately',
    :'head_html' => :'headHtml',
    :'footer_html' => :'footerHtml',
    :'content_type_category' => :'contentTypeCategory',
    :'current_state' => :'currentState',
    :'link_rel_canonical_url' => :'linkRelCanonicalUrl',
    :'featured_image' => :'featuredImage',
    :'featured_image_alt_text' => :'featuredImageAltText',
    :'public_access_rules_enabled' => :'publicAccessRulesEnabled',
    :'public_access_rules' => :'publicAccessRules',
    :'layout_sections' => :'layoutSections',
    :'theme_settings_values' => :'themeSettingsValues',
    :'url' => :'url',
    :'publish_date' => :'publishDate',
    :'deleted_at' => :'deletedAt',
    :'created_at' => :'createdAt',
    :'published' => :'published',
    :'updated_at' => :'updatedAt'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



1087
1088
1089
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1087

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



346
347
348
349
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 346

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



279
280
281
282
283
284
285
286
287
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 279

def self.openapi_types
  {
    :'id' => :'String',
    :'slug' => :'String',
    :'content_group_id' => :'String',
    :'campaign' => :'String',
    :'category_id' => :'Integer',
    :'state' => :'String',
    :'template_path' => :'String',
    :'name' => :'String',
    :'mab_experiment_id' => :'String',
    :'archived' => :'Boolean',
    :'author_name' => :'String',
    :'ab_test_id' => :'String',
    :'created_by_id' => :'String',
    :'updated_by_id' => :'String',
    :'domain' => :'String',
    :'subcategory' => :'String',
    :'ab_status' => :'String',
    :'folder_id' => :'String',
    :'widget_containers' => :'Object',
    :'widgets' => :'Object',
    :'language' => :'String',
    :'translated_from_id' => :'String',
    :'dynamic_page_hub_db_table_id' => :'String',
    :'blog_author_id' => :'String',
    :'html_title' => :'String',
    :'page_redirected' => :'Boolean',
    :'page_expiry_enabled' => :'Boolean',
    :'page_expiry_date' => :'Integer',
    :'page_expiry_redirect_id' => :'Integer',
    :'page_expiry_redirect_url' => :'String',
    :'use_featured_image' => :'Boolean',
    :'tag_ids' => :'Array<Integer>',
    :'enable_google_amp_output_override' => :'Boolean',
    :'_post_body' => :'String',
    :'post_summary' => :'String',
    :'rss_body' => :'String',
    :'rss_summary' => :'String',
    :'password' => :'String',
    :'attached_stylesheets' => :'Array<Object>',
    :'include_default_custom_css' => :'Boolean',
    :'enable_domain_stylesheets' => :'Boolean',
    :'enable_layout_stylesheets' => :'Boolean',
    :'meta_description' => :'String',
    :'publish_immediately' => :'Boolean',
    :'head_html' => :'String',
    :'footer_html' => :'String',
    :'content_type_category' => :'String',
    :'current_state' => :'String',
    :'link_rel_canonical_url' => :'String',
    :'featured_image' => :'String',
    :'featured_image_alt_text' => :'String',
    :'public_access_rules_enabled' => :'Boolean',
    :'public_access_rules' => :'Array<Object>',
    :'layout_sections' => :'Hash<String, LayoutSection>',
    :'theme_settings_values' => :'Object',
    :'url' => :'String',
    :'publish_date' => :'DateTime',
    :'deleted_at' => :'DateTime',
    :'created_at' => :'DateTime',
    :'published' => :'Boolean',
    :'updated_at' => :'DateTime'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1006

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      slug == o.slug &&
      content_group_id == o.content_group_id &&
      campaign == o.campaign &&
      category_id == o.category_id &&
      state == o.state &&
      template_path == o.template_path &&
      name == o.name &&
      mab_experiment_id == o.mab_experiment_id &&
      archived == o.archived &&
      author_name == o.author_name &&
      ab_test_id == o.ab_test_id &&
      created_by_id == o.created_by_id &&
      updated_by_id == o.updated_by_id &&
      domain == o.domain &&
      subcategory == o.subcategory &&
      ab_status == o.ab_status &&
      folder_id == o.folder_id &&
      widget_containers == o.widget_containers &&
      widgets == o.widgets &&
      language == o.language &&
      translated_from_id == o.translated_from_id &&
      dynamic_page_hub_db_table_id == o.dynamic_page_hub_db_table_id &&
      blog_author_id == o.blog_author_id &&
      html_title == o.html_title &&
      page_redirected == o.page_redirected &&
      page_expiry_enabled == o.page_expiry_enabled &&
      page_expiry_date == o.page_expiry_date &&
      page_expiry_redirect_id == o.page_expiry_redirect_id &&
      page_expiry_redirect_url == o.page_expiry_redirect_url &&
      use_featured_image == o.use_featured_image &&
      tag_ids == o.tag_ids &&
      enable_google_amp_output_override == o.enable_google_amp_output_override &&
      _post_body == o._post_body &&
      post_summary == o.post_summary &&
      rss_body == o.rss_body &&
      rss_summary == o.rss_summary &&
      password == o.password &&
      attached_stylesheets == o.attached_stylesheets &&
      include_default_custom_css == o.include_default_custom_css &&
      enable_domain_stylesheets == o.enable_domain_stylesheets &&
      enable_layout_stylesheets == o.enable_layout_stylesheets &&
      meta_description == o.meta_description &&
      publish_immediately == o.publish_immediately &&
      head_html == o.head_html &&
      footer_html == o.footer_html &&
      content_type_category == o.content_type_category &&
      current_state == o.current_state &&
      link_rel_canonical_url == o.link_rel_canonical_url &&
      featured_image == o.featured_image &&
      featured_image_alt_text == o.featured_image_alt_text &&
      public_access_rules_enabled == o.public_access_rules_enabled &&
      public_access_rules == o.public_access_rules &&
      layout_sections == o.layout_sections &&
      theme_settings_values == o.theme_settings_values &&
      url == o.url &&
      publish_date == o.publish_date &&
      deleted_at == o.deleted_at &&
      created_at == o.created_at &&
      published == o.published &&
      updated_at == o.updated_at
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1115

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    Hubspot::Cms::Blogs::BlogPosts.const_get(type).build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1184

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1094

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if 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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


1074
1075
1076
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1074

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



1080
1081
1082
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1080

def hash
  [id, slug, content_group_id, campaign, category_id, state, template_path, name, mab_experiment_id, archived, author_name, ab_test_id, created_by_id, updated_by_id, domain, subcategory, ab_status, folder_id, widget_containers, widgets, language, translated_from_id, dynamic_page_hub_db_table_id, blog_author_id, html_title, page_redirected, page_expiry_enabled, page_expiry_date, page_expiry_redirect_id, page_expiry_redirect_url, use_featured_image, tag_ids, enable_google_amp_output_override, _post_body, post_summary, rss_body, rss_summary, password, attached_stylesheets, include_default_custom_css, enable_domain_stylesheets, enable_layout_stylesheets, meta_description, publish_immediately, head_html, footer_html, content_type_category, current_state, link_rel_canonical_url, featured_image, featured_image_alt_text, public_access_rules_enabled, public_access_rules, layout_sections, theme_settings_values, url, publish_date, deleted_at, created_at, published, updated_at].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 621

def list_invalid_properties
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @slug.nil?
    invalid_properties.push('invalid value for "slug", slug cannot be nil.')
  end

  if @content_group_id.nil?
    invalid_properties.push('invalid value for "content_group_id", content_group_id cannot be nil.')
  end

  if @campaign.nil?
    invalid_properties.push('invalid value for "campaign", campaign cannot be nil.')
  end

  if @category_id.nil?
    invalid_properties.push('invalid value for "category_id", category_id cannot be nil.')
  end

  if @state.nil?
    invalid_properties.push('invalid value for "state", state cannot be nil.')
  end

  if @state.to_s.length > 25
    invalid_properties.push('invalid value for "state", the character length must be smaller than or equal to 25.')
  end

  if @template_path.nil?
    invalid_properties.push('invalid value for "template_path", template_path cannot be nil.')
  end

  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @mab_experiment_id.nil?
    invalid_properties.push('invalid value for "mab_experiment_id", mab_experiment_id cannot be nil.')
  end

  if @archived.nil?
    invalid_properties.push('invalid value for "archived", archived cannot be nil.')
  end

  if @author_name.nil?
    invalid_properties.push('invalid value for "author_name", author_name cannot be nil.')
  end

  if @ab_test_id.nil?
    invalid_properties.push('invalid value for "ab_test_id", ab_test_id cannot be nil.')
  end

  if @created_by_id.nil?
    invalid_properties.push('invalid value for "created_by_id", created_by_id cannot be nil.')
  end

  if @updated_by_id.nil?
    invalid_properties.push('invalid value for "updated_by_id", updated_by_id cannot be nil.')
  end

  if @domain.nil?
    invalid_properties.push('invalid value for "domain", domain cannot be nil.')
  end

  if @subcategory.nil?
    invalid_properties.push('invalid value for "subcategory", subcategory cannot be nil.')
  end

  if @ab_status.nil?
    invalid_properties.push('invalid value for "ab_status", ab_status cannot be nil.')
  end

  if @folder_id.nil?
    invalid_properties.push('invalid value for "folder_id", folder_id cannot be nil.')
  end

  if @widget_containers.nil?
    invalid_properties.push('invalid value for "widget_containers", widget_containers cannot be nil.')
  end

  if @widgets.nil?
    invalid_properties.push('invalid value for "widgets", widgets cannot be nil.')
  end

  if @language.nil?
    invalid_properties.push('invalid value for "language", language cannot be nil.')
  end

  if @translated_from_id.nil?
    invalid_properties.push('invalid value for "translated_from_id", translated_from_id cannot be nil.')
  end

  if @dynamic_page_hub_db_table_id.nil?
    invalid_properties.push('invalid value for "dynamic_page_hub_db_table_id", dynamic_page_hub_db_table_id cannot be nil.')
  end

  if @blog_author_id.nil?
    invalid_properties.push('invalid value for "blog_author_id", blog_author_id cannot be nil.')
  end

  if @html_title.nil?
    invalid_properties.push('invalid value for "html_title", html_title cannot be nil.')
  end

  if @page_redirected.nil?
    invalid_properties.push('invalid value for "page_redirected", page_redirected cannot be nil.')
  end

  if @page_expiry_enabled.nil?
    invalid_properties.push('invalid value for "page_expiry_enabled", page_expiry_enabled cannot be nil.')
  end

  if @page_expiry_date.nil?
    invalid_properties.push('invalid value for "page_expiry_date", page_expiry_date cannot be nil.')
  end

  if @page_expiry_redirect_id.nil?
    invalid_properties.push('invalid value for "page_expiry_redirect_id", page_expiry_redirect_id cannot be nil.')
  end

  if @page_expiry_redirect_url.nil?
    invalid_properties.push('invalid value for "page_expiry_redirect_url", page_expiry_redirect_url cannot be nil.')
  end

  if @use_featured_image.nil?
    invalid_properties.push('invalid value for "use_featured_image", use_featured_image cannot be nil.')
  end

  if @tag_ids.nil?
    invalid_properties.push('invalid value for "tag_ids", tag_ids cannot be nil.')
  end

  if @enable_google_amp_output_override.nil?
    invalid_properties.push('invalid value for "enable_google_amp_output_override", enable_google_amp_output_override cannot be nil.')
  end

  if @_post_body.nil?
    invalid_properties.push('invalid value for "_post_body", _post_body cannot be nil.')
  end

  if @post_summary.nil?
    invalid_properties.push('invalid value for "post_summary", post_summary cannot be nil.')
  end

  if @rss_body.nil?
    invalid_properties.push('invalid value for "rss_body", rss_body cannot be nil.')
  end

  if @rss_summary.nil?
    invalid_properties.push('invalid value for "rss_summary", rss_summary cannot be nil.')
  end

  if @password.nil?
    invalid_properties.push('invalid value for "password", password cannot be nil.')
  end

  if @attached_stylesheets.nil?
    invalid_properties.push('invalid value for "attached_stylesheets", attached_stylesheets cannot be nil.')
  end

  if @include_default_custom_css.nil?
    invalid_properties.push('invalid value for "include_default_custom_css", include_default_custom_css cannot be nil.')
  end

  if @enable_domain_stylesheets.nil?
    invalid_properties.push('invalid value for "enable_domain_stylesheets", enable_domain_stylesheets cannot be nil.')
  end

  if @enable_layout_stylesheets.nil?
    invalid_properties.push('invalid value for "enable_layout_stylesheets", enable_layout_stylesheets cannot be nil.')
  end

  if @meta_description.nil?
    invalid_properties.push('invalid value for "meta_description", meta_description cannot be nil.')
  end

  if @publish_immediately.nil?
    invalid_properties.push('invalid value for "publish_immediately", publish_immediately cannot be nil.')
  end

  if @head_html.nil?
    invalid_properties.push('invalid value for "head_html", head_html cannot be nil.')
  end

  if @footer_html.nil?
    invalid_properties.push('invalid value for "footer_html", footer_html cannot be nil.')
  end

  if @content_type_category.nil?
    invalid_properties.push('invalid value for "content_type_category", content_type_category cannot be nil.')
  end

  if @current_state.nil?
    invalid_properties.push('invalid value for "current_state", current_state cannot be nil.')
  end

  if @link_rel_canonical_url.nil?
    invalid_properties.push('invalid value for "link_rel_canonical_url", link_rel_canonical_url cannot be nil.')
  end

  if @featured_image.nil?
    invalid_properties.push('invalid value for "featured_image", featured_image cannot be nil.')
  end

  if @featured_image_alt_text.nil?
    invalid_properties.push('invalid value for "featured_image_alt_text", featured_image_alt_text cannot be nil.')
  end

  if @public_access_rules_enabled.nil?
    invalid_properties.push('invalid value for "public_access_rules_enabled", public_access_rules_enabled cannot be nil.')
  end

  if @public_access_rules.nil?
    invalid_properties.push('invalid value for "public_access_rules", public_access_rules cannot be nil.')
  end

  if @layout_sections.nil?
    invalid_properties.push('invalid value for "layout_sections", layout_sections cannot be nil.')
  end

  if @theme_settings_values.nil?
    invalid_properties.push('invalid value for "theme_settings_values", theme_settings_values cannot be nil.')
  end

  if @url.nil?
    invalid_properties.push('invalid value for "url", url cannot be nil.')
  end

  if @publish_date.nil?
    invalid_properties.push('invalid value for "publish_date", publish_date cannot be nil.')
  end

  if @deleted_at.nil?
    invalid_properties.push('invalid value for "deleted_at", deleted_at cannot be nil.')
  end

  if @created_at.nil?
    invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
  end

  if @published.nil?
    invalid_properties.push('invalid value for "published", published cannot be nil.')
  end

  if @updated_at.nil?
    invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



1160
1161
1162
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1160

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1166

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



1154
1155
1156
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 1154

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
# File 'lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb', line 876

def valid?
  return false if @id.nil?
  return false if @slug.nil?
  return false if @content_group_id.nil?
  return false if @campaign.nil?
  return false if @category_id.nil?
  return false if @state.nil?
  return false if @state.to_s.length > 25
  return false if @template_path.nil?
  return false if @name.nil?
  return false if @mab_experiment_id.nil?
  return false if @archived.nil?
  return false if @author_name.nil?
  return false if @ab_test_id.nil?
  return false if @created_by_id.nil?
  return false if @updated_by_id.nil?
  return false if @domain.nil?
  return false if @subcategory.nil?
  return false if @ab_status.nil?
  ab_status_validator = EnumAttributeValidator.new('String', ["master", "variant", "loser_variant", "mab_master", "mab_variant", "automated_master", "automated_variant", "automated_loser_variant"])
  return false unless ab_status_validator.valid?(@ab_status)
  return false if @folder_id.nil?
  return false if @widget_containers.nil?
  return false if @widgets.nil?
  return false if @language.nil?
  language_validator = EnumAttributeValidator.new('String', ["af", "af-na", "af-za", "agq", "agq-cm", "ak", "ak-gh", "am", "am-et", "ar", "ar-001", "ar-ae", "ar-bh", "ar-dj", "ar-dz", "ar-eg", "ar-eh", "ar-er", "ar-il", "ar-iq", "ar-jo", "ar-km", "ar-kw", "ar-lb", "ar-ly", "ar-ma", "ar-mr", "ar-om", "ar-ps", "ar-qa", "ar-sa", "ar-sd", "ar-so", "ar-ss", "ar-sy", "ar-td", "ar-tn", "ar-ye", "as", "as-in", "asa", "asa-tz", "ast", "ast-es", "az", "az-az", "bas", "bas-cm", "be", "be-by", "bem", "bem-zm", "bez", "bez-tz", "bg", "bg-bg", "bm", "bm-ml", "bn", "bn-bd", "bn-in", "bo", "bo-cn", "bo-in", "br", "br-fr", "brx", "brx-in", "bs", "bs-ba", "ca", "ca-ad", "ca-es", "ca-fr", "ca-it", "ccp", "ccp-bd", "ccp-in", "ce", "ce-ru", "cgg", "cgg-ug", "chr", "chr-us", "ckb", "ckb-iq", "ckb-ir", "cs", "cs-cz", "cu", "cu-ru", "cy", "cy-gb", "da", "da-dk", "da-gl", "dav", "dav-ke", "de", "de-at", "de-be", "de-ch", "de-de", "de-gr", "de-it", "de-li", "de-lu", "dje", "dje-ne", "dsb", "dsb-de", "dua", "dua-cm", "dyo", "dyo-sn", "dz", "dz-bt", "ebu", "ebu-ke", "ee", "ee-gh", "ee-tg", "el", "el-cy", "el-gr", "en", "en-001", "en-150", "en-ag", "en-ai", "en-as", "en-at", "en-au", "en-bb", "en-be", "en-bi", "en-bm", "en-bs", "en-bw", "en-bz", "en-ca", "en-cc", "en-ch", "en-ck", "en-cm", "en-cx", "en-cy", "en-de", "en-dg", "en-dk", "en-dm", "en-er", "en-fi", "en-fj", "en-fk", "en-fm", "en-gb", "en-gd", "en-gg", "en-gh", "en-gi", "en-gm", "en-gu", "en-gy", "en-hk", "en-ie", "en-il", "en-im", "en-in", "en-io", "en-je", "en-jm", "en-ke", "en-ki", "en-kn", "en-ky", "en-lc", "en-lr", "en-ls", "en-mg", "en-mh", "en-mo", "en-mp", "en-ms", "en-mt", "en-mu", "en-mw", "en-my", "en-na", "en-nf", "en-ng", "en-nl", "en-nr", "en-nu", "en-nz", "en-pg", "en-ph", "en-pk", "en-pn", "en-pr", "en-pw", "en-rw", "en-sb", "en-sc", "en-sd", "en-se", "en-sg", "en-sh", "en-si", "en-sl", "en-ss", "en-sx", "en-sz", "en-tc", "en-tk", "en-to", "en-tt", "en-tv", "en-tz", "en-ug", "en-um", "en-us", "en-vc", "en-vg", "en-vi", "en-vu", "en-ws", "en-za", "en-zm", "en-zw", "eo", "eo-001", "es", "es-419", "es-ar", "es-bo", "es-br", "es-bz", "es-cl", "es-co", "es-cr", "es-cu", "es-do", "es-ea", "es-ec", "es-es", "es-gq", "es-gt", "es-hn", "es-ic", "es-mx", "es-ni", "es-pa", "es-pe", "es-ph", "es-pr", "es-py", "es-sv", "es-us", "es-uy", "es-ve", "et", "et-ee", "eu", "eu-es", "ewo", "ewo-cm", "fa", "fa-af", "fa-ir", "ff", "ff-cm", "ff-gn", "ff-mr", "ff-sn", "fi", "fi-fi", "fil", "fil-ph", "fo", "fo-dk", "fo-fo", "fr", "fr-be", "fr-bf", "fr-bi", "fr-bj", "fr-bl", "fr-ca", "fr-cd", "fr-cf", "fr-cg", "fr-ch", "fr-ci", "fr-cm", "fr-dj", "fr-dz", "fr-fr", "fr-ga", "fr-gf", "fr-gn", "fr-gp", "fr-gq", "fr-ht", "fr-km", "fr-lu", "fr-ma", "fr-mc", "fr-mf", "fr-mg", "fr-ml", "fr-mq", "fr-mr", "fr-mu", "fr-nc", "fr-ne", "fr-pf", "fr-pm", "fr-re", "fr-rw", "fr-sc", "fr-sn", "fr-sy", "fr-td", "fr-tg", "fr-tn", "fr-vu", "fr-wf", "fr-yt", "fur", "fur-it", "fy", "fy-nl", "ga", "ga-ie", "gd", "gd-gb", "gl", "gl-es", "gsw", "gsw-ch", "gsw-fr", "gsw-li", "gu", "gu-in", "guz", "guz-ke", "gv", "gv-im", "ha", "ha-gh", "ha-ne", "ha-ng", "haw", "haw-us", "he", "hi", "hi-in", "hr", "hr-ba", "hr-hr", "hsb", "hsb-de", "hu", "hu-hu", "hy", "hy-am", "id", "ig", "ig-ng", "ii", "ii-cn", "id-id", "is", "is-is", "it", "it-ch", "it-it", "it-sm", "it-va", "he-il", "ja", "ja-jp", "jgo", "jgo-cm", "yi", "yi-001", "jmc", "jmc-tz", "ka", "ka-ge", "kab", "kab-dz", "kam", "kam-ke", "kde", "kde-tz", "kea", "kea-cv", "khq", "khq-ml", "ki", "ki-ke", "kk", "kk-kz", "kkj", "kkj-cm", "kl", "kl-gl", "kln", "kln-ke", "km", "km-kh", "kn", "kn-in", "ko", "ko-kp", "ko-kr", "kok", "kok-in", "ks", "ks-in", "ksb", "ksb-tz", "ksf", "ksf-cm", "ksh", "ksh-de", "kw", "kw-gb", "ky", "ky-kg", "lag", "lag-tz", "lb", "lb-lu", "lg", "lg-ug", "lkt", "lkt-us", "ln", "ln-ao", "ln-cd", "ln-cf", "ln-cg", "lo", "lo-la", "lrc", "lrc-iq", "lrc-ir", "lt", "lt-lt", "lu", "lu-cd", "luo", "luo-ke", "luy", "luy-ke", "lv", "lv-lv", "mas", "mas-ke", "mas-tz", "mer", "mer-ke", "mfe", "mfe-mu", "mg", "mg-mg", "mgh", "mgh-mz", "mgo", "mgo-cm", "mk", "mk-mk", "ml", "ml-in", "mn", "mn-mn", "mr", "mr-in", "ms", "ms-bn", "ms-my", "ms-sg", "mt", "mt-mt", "mua", "mua-cm", "my", "my-mm", "mzn", "mzn-ir", "naq", "naq-na", "nb", "nb-no", "nb-sj", "nd", "nd-zw", "nds", "nds-de", "nds-nl", "ne", "ne-in", "ne-np", "nl", "nl-aw", "nl-be", "nl-bq", "nl-cw", "nl-nl", "nl-sr", "nl-sx", "nmg", "nmg-cm", "nn", "nn-no", "nnh", "nnh-cm", "no", "no-no", "nus", "nus-ss", "nyn", "nyn-ug", "om", "om-et", "om-ke", "or", "or-in", "os", "os-ge", "os-ru", "pa", "pa-in", "pa-pk", "pl", "pl-pl", "prg", "prg-001", "ps", "ps-af", "pt", "pt-ao", "pt-br", "pt-ch", "pt-cv", "pt-gq", "pt-gw", "pt-lu", "pt-mo", "pt-mz", "pt-pt", "pt-st", "pt-tl", "qu", "qu-bo", "qu-ec", "qu-pe", "rm", "rm-ch", "rn", "rn-bi", "ro", "ro-md", "ro-ro", "rof", "rof-tz", "ru", "ru-by", "ru-kg", "ru-kz", "ru-md", "ru-ru", "ru-ua", "rw", "rw-rw", "rwk", "rwk-tz", "sa", "sah", "sah-ru", "saq", "saq-ke", "sbp", "sbp-tz", "sd", "sd-pk", "se", "se-fi", "se-no", "se-se", "seh", "seh-mz", "ses", "ses-ml", "sg", "sg-cf", "shi", "shi-ma", "si", "si-lk", "sk", "sk-sk", "sl", "sl-si", "smn", "smn-fi", "sn", "sn-zw", "so", "so-dj", "so-et", "so-ke", "so-so", "sq", "sq-al", "sq-mk", "sq-xk", "sr", "sr-ba", "sr-cs", "sr-me", "sr-rs", "sr-xk", "sv", "sv-ax", "sv-fi", "sv-se", "sw", "sw-cd", "sw-ke", "sw-tz", "sw-ug", "sy", "ta", "ta-in", "ta-lk", "ta-my", "ta-sg", "te", "te-in", "teo", "teo-ke", "teo-ug", "tg", "tg-tj", "th", "th-th", "ti", "ti-er", "ti-et", "tk", "tk-tm", "to", "to-to", "tr", "tr-cy", "tr-tr", "tt", "tt-ru", "twq", "twq-ne", "tzm", "tzm-ma", "ug", "ug-cn", "uk", "uk-ua", "ur", "ur-in", "ur-pk", "uz", "uz-af", "uz-uz", "vai", "vai-lr", "vi", "vi-vn", "vo", "vo-001", "vun", "vun-tz", "wae", "wae-ch", "wo", "wo-sn", "xog", "xog-ug", "yav", "yav-cm", "yo", "yo-bj", "yo-ng", "yue", "yue-cn", "yue-hk", "zgh", "zgh-ma", "zh", "zh-cn", "zh-hk", "zh-mo", "zh-sg", "zh-tw", "zh-hans", "zh-hant", "zu", "zu-za"])
  return false unless language_validator.valid?(@language)
  return false if @translated_from_id.nil?
  return false if @dynamic_page_hub_db_table_id.nil?
  return false if @blog_author_id.nil?
  return false if @html_title.nil?
  return false if @page_redirected.nil?
  return false if @page_expiry_enabled.nil?
  return false if @page_expiry_date.nil?
  return false if @page_expiry_redirect_id.nil?
  return false if @page_expiry_redirect_url.nil?
  return false if @use_featured_image.nil?
  return false if @tag_ids.nil?
  return false if @enable_google_amp_output_override.nil?
  return false if @_post_body.nil?
  return false if @post_summary.nil?
  return false if @rss_body.nil?
  return false if @rss_summary.nil?
  return false if @password.nil?
  return false if @attached_stylesheets.nil?
  return false if @include_default_custom_css.nil?
  return false if @enable_domain_stylesheets.nil?
  return false if @enable_layout_stylesheets.nil?
  return false if @meta_description.nil?
  return false if @publish_immediately.nil?
  return false if @head_html.nil?
  return false if @footer_html.nil?
  return false if @content_type_category.nil?
  content_type_category_validator = EnumAttributeValidator.new('String', ["0", "1", "2", "3", "4", "5", "6"])
  return false unless content_type_category_validator.valid?(@content_type_category)
  return false if @current_state.nil?
  current_state_validator = EnumAttributeValidator.new('String', ["AUTOMATED", "AUTOMATED_DRAFT", "AUTOMATED_SENDING", "AUTOMATED_FOR_FORM", "AUTOMATED_FOR_FORM_BUFFER", "AUTOMATED_FOR_FORM_DRAFT", "AUTOMATED_FOR_FORM_LEGACY", "BLOG_EMAIL_DRAFT", "BLOG_EMAIL_PUBLISHED", "DRAFT", "DRAFT_AB", "DRAFT_AB_VARIANT", "ERROR", "LOSER_AB_VARIANT", "PAGE_STUB", "PRE_PROCESSING", "PROCESSING", "PUBLISHED", "PUBLISHED_AB", "PUBLISHED_AB_VARIANT", "PUBLISHED_OR_SCHEDULED", "RSS_TO_EMAIL_DRAFT", "RSS_TO_EMAIL_PUBLISHED", "SCHEDULED", "SCHEDULED_AB", "SCHEDULED_OR_PUBLISHED", "AUTOMATED_AB", "AUTOMATED_AB_VARIANT", "AUTOMATED_DRAFT_AB", "AUTOMATED_DRAFT_ABVARIANT", "AUTOMATED_LOSER_ABVARIANT"])
  return false unless current_state_validator.valid?(@current_state)
  return false if @link_rel_canonical_url.nil?
  return false if @featured_image.nil?
  return false if @featured_image_alt_text.nil?
  return false if @public_access_rules_enabled.nil?
  return false if @public_access_rules.nil?
  return false if @layout_sections.nil?
  return false if @theme_settings_values.nil?
  return false if @url.nil?
  return false if @publish_date.nil?
  return false if @deleted_at.nil?
  return false if @created_at.nil?
  return false if @published.nil?
  return false if @updated_at.nil?
  true
end