Class: HubSpotSDK::Resources::Cms::Blogs::Posts::Revisions
- Inherits:
-
Object
- Object
- HubSpotSDK::Resources::Cms::Blogs::Posts::Revisions
- Defined in:
- lib/hubspot_sdk/resources/cms/blogs/posts/revisions.rb
Instance Method Summary collapse
-
#get_previous_version(revision_id, object_id_:, request_options: {}) ⇒ StringIO
Retrieve a previous version of a blog post.
-
#get_previous_versions(object_id_, after: nil, before: nil, limit: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Cms::Blogs::Posts::RevisionGetPreviousVersionsParams for more details.
-
#initialize(client:) ⇒ Revisions
constructor
private
A new instance of Revisions.
-
#restore_previous_version(revision_id, object_id_:, request_options: {}) ⇒ StringIO
Restores a blog post to one of its previous versions.
-
#restore_previous_version_to_draft(revision_id, object_id_:, request_options: {}) ⇒ StringIO
Takes a specified version of a blog post, sets it as the new draft version of the blog post.
Constructor Details
#initialize(client:) ⇒ Revisions
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Revisions.
131 132 133 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/revisions.rb', line 131 def initialize(client:) @client = client end |
Instance Method Details
#get_previous_version(revision_id, object_id_:, request_options: {}) ⇒ StringIO
Retrieve a previous version of a blog post.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/revisions.rb', line 20 def get_previous_version(revision_id, params) parsed, = HubSpotSDK::Cms::Blogs::Posts::RevisionGetPreviousVersionParams.dump_request(params) object_id_ = parsed.delete(:object_id_) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["cms/blogs/2026-03/posts/%1$s/revisions/%2$s", object_id_, revision_id], headers: {"accept" => "*/*"}, model: StringIO, options: ) end |
#get_previous_versions(object_id_, after: nil, before: nil, limit: nil, request_options: {}) ⇒ StringIO
Some parameter documentations has been truncated, see Models::Cms::Blogs::Posts::RevisionGetPreviousVersionsParams for more details.
Retrieve all the previous versions of a blog post.
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/revisions.rb', line 56 def get_previous_versions(object_id_, params = {}) parsed, = HubSpotSDK::Cms::Blogs::Posts::RevisionGetPreviousVersionsParams.dump_request(params) query = HubSpotSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["cms/blogs/2026-03/posts/%1$s/revisions", object_id_], query: query, headers: {"accept" => "*/*"}, model: StringIO, options: ) end |
#restore_previous_version(revision_id, object_id_:, request_options: {}) ⇒ StringIO
Restores a blog post to one of its previous versions.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/revisions.rb', line 80 def restore_previous_version(revision_id, params) parsed, = HubSpotSDK::Cms::Blogs::Posts::RevisionRestorePreviousVersionParams.dump_request(params) object_id_ = parsed.delete(:object_id_) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["cms/blogs/2026-03/posts/%1$s/revisions/%2$s/restore", object_id_, revision_id], headers: {"accept" => "*/*"}, model: StringIO, options: ) end |
#restore_previous_version_to_draft(revision_id, object_id_:, request_options: {}) ⇒ StringIO
Takes a specified version of a blog post, sets it as the new draft version of the blog post.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/hubspot_sdk/resources/cms/blogs/posts/revisions.rb', line 108 def restore_previous_version_to_draft(revision_id, params) parsed, = HubSpotSDK::Cms::Blogs::Posts::RevisionRestorePreviousVersionToDraftParams.dump_request(params) object_id_ = parsed.delete(:object_id_) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: [ "cms/blogs/2026-03/posts/%1$s/revisions/%2$s/restore-to-draft", object_id_, revision_id ], headers: {"accept" => "*/*"}, model: StringIO, options: ) end |