Sha256: c3ee5c88ebf9a689da982ee9f16a3cf6143e35408cefa886514f6c9266e85db8

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

require_relative 'client_association_methods_factory'

module Contentful
  module Management
    # Wrapper for Webhook API for usage from within Client
    # @private
    class ClientSnapshotMethodsFactory
      include Contentful::Management::ClientAssociationMethodsFactory

      def initialize(client, space_id, environment_id, resource_type)
        super(client, space_id, environment_id)
        @resource_type = resource_type
      end

      def create(*)
        fail 'Not supported'
      end

      def all(resource_id, params = {})
        @resource_requester.all(
          {
            resource_type: @resource_type,
            space_id: @space_id,
            environment_id: @environment_id,
            resource_id: resource_id
          },
          params
        )
      end

      def find(resource_id, snapshot_id)
        @resource_requester.find(
          resource_type: @resource_type,
          space_id: @space_id,
          environment_id: @environment_id,
          resource_id: resource_id,
          snapshot_id: snapshot_id
        )
      end

      def new(*)
        fail 'Not supported'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contentful-management-3.10.0 lib/contentful/management/client_snapshot_methods_factory.rb
contentful-management-3.9.0 lib/contentful/management/client_snapshot_methods_factory.rb