class Contentful::Management::Snapshot
Resource
class for Snapshot
. @see _ www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots
Public Class Methods
Source
# File lib/contentful/management/snapshot.rb, line 43 def self.all(client, space_id, environment_id, resource_id, resource_type = 'entries', params = {}) ClientSnapshotMethodsFactory.new(client, space_id, environment_id, resource_type).all(resource_id, params) end
Gets all snapshots for a resource
@param [Contentful::Management::Client] client @param [String] space_id @param [String] environment_id @param [String] resource_id @param [String] resource_type
@return [Contentful::Management::Array<Contentful::Management::Snapshot>] rubocop:disable Metrics/ParameterLists
Source
# File lib/contentful/management/snapshot.rb, line 72 def self.build_endpoint(endpoint_options) resource_type = endpoint_options.fetch(:resource_type, 'entries') space_id = endpoint_options.fetch(:space_id) environment_id = endpoint_options.fetch(:environment_id) resource_id = endpoint_options.fetch(:resource_id) snapshot_id = endpoint_options.fetch(:snapshot_id, nil) endpoint = "spaces/#{space_id}/environments/#{environment_id}/#{resource_type}/#{resource_id}/snapshots" endpoint = "#{endpoint}/#{snapshot_id}" if snapshot_id endpoint end
@private
Source
# File lib/contentful/management/snapshot.rb, line 62 def self.create(*) fail 'Not supported' end
Not supported
Source
# File lib/contentful/management/snapshot.rb, line 67 def self.endpoint 'snapshots' end
@private
Source
# File lib/contentful/management/snapshot.rb, line 57 def self.find(client, space_id, environment_id, resource_id, snapshot_id, resource_type = 'entries') ClientSnapshotMethodsFactory.new(client, space_id, environment_id, resource_type).find(resource_id, snapshot_id) end
Gets a snapshot by ID
@param [Contentful::Management::Client] client @param [String] space_id @param [String] environment_id @param [String] resource_id @param [String] snapshot_id @param [String] resource_type
@return [Contentful::Management::Snapshot]
Source
# File lib/contentful/management/snapshot.rb, line 18 def self.property_coercions { snapshot: lambda do |h| case h.fetch('sys', {})['type'] when 'Entry' DynamicEntry.new(h) when 'ContentType' ContentType.new(h) end end } end
@private
Public Instance Methods
Source
# File lib/contentful/management/snapshot.rb, line 86 def destroy fail 'Not supported' end
Not supported
Source
# File lib/contentful/management/snapshot.rb, line 91 def update(*) fail 'Not supported' end
Not supported