Sha256: b2b642e79f2f27e0e554d5857b5f3d3397870bf9bb45b49f807edbb3806dcd9c

Contents?: true

Size: 1.5 KB

Versions: 33

Compression:

Stored size: 1.5 KB

Contents

require_relative 'resource_requester'

module Contentful
  module Management
    # Wrapper for Entry manipulation for a specific Content Type
    # @private
    class ContentTypeSnapshotMethodsFactory
      attr_reader :content_type

      # @private
      def initialize(content_type)
        @content_type = content_type
      end

      # Gets all snapshot for a specific content type.
      #
      # @see _ For complete option list: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots/content-type-snapshots-collection
      #
      # @return [Contentful::Management::Array<Contentful::Management::Snapshot>]
      def all(params = {})
        Snapshot.all(
          content_type.client,
          content_type.space.id,
          content_type.environment_id,
          content_type.id,
          'content_types',
          params
        )
      end

      # Gets a snapshot by ID for a specific content type.
      #
      # @param [String] snapshot_id
      # @see _ For complete option list: https://www.contentful.com/developers/docs/references/content-management-api/#/reference/snapshots/content-type-snapshots-collection
      #
      # @return [Contentful::Management::Array<Contentful::Management::Snapshot>]
      def find(snapshot_id)
        Snapshot.find(
          content_type.client,
          content_type.space.id,
          content_type.environment_id,
          content_type.id,
          snapshot_id,
          'content_types'
        )
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
contentful-management-3.8.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-3.7.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-3.6.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-3.5.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-3.4.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-3.3.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-3.2.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-3.1.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-3.0.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.13.1 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.13.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.12.1 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.12.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.11.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.10.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.9.1 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.9.0 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.8.2 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.8.1 lib/contentful/management/content_type_snapshot_methods_factory.rb
contentful-management-2.8.0 lib/contentful/management/content_type_snapshot_methods_factory.rb