Sha256: 70244c94695914ae6d8aebe3c724c34f5dbcba9d9d6afca506f5e8ff91b4004d

Contents?: true

Size: 1.57 KB

Versions: 12

Compression:

Stored size: 1.57 KB

Contents

module Lokalise
  class Client
    # Returns all snapshots for the given project
    #
    # @see https://lokalise.co/api2docs/ruby/#transition-list-all-snapshots-get
    # @return [Lokalise::Collection::Snapshot<Lokalise::Resources::Snapshot>]
    # @param project_id [String]
    # @param params [Hash]
    def snapshots(project_id, params = {})
      c_r Lokalise::Collections::Snapshot, :all, project_id, params
    end

    # Creates snapshot for the given project
    #
    # @see https://lokalise.co/api2docs/ruby/#transition-create-a-snapshot-post
    # @return [Lokalise::Resources::Snapshot]
    # @param project_id [String]
    # @param params [Hash]
    def create_snapshot(project_id, params = {})
      c_r Lokalise::Resources::Snapshot, :create, project_id, params
    end

    # Restore project from the given snapshot by producing project's copy
    #
    # @see https://lokalise.co/api2docs/ruby/#transition-restore-a-snapshot-post
    # @return [Lokalise::Resources::Project]
    # @param project_id [String]
    # @param snapshot_id [String, Integer]
    def restore_snapshot(project_id, snapshot_id)
      c_r Lokalise::Resources::Snapshot, :restore, [project_id, snapshot_id]
    end

    # Deletes snapshot
    #
    # @see https://lokalise.co/api2docs/ruby/#transition-delete-a-snapshot-delete
    # @return [Hash]
    # @param project_id [String]
    # @param snapshot_id [String, Integer]
    def destroy_snapshot(project_id, snapshot_id)
      c_r Lokalise::Resources::Snapshot, :destroy, [project_id, snapshot_id]
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ruby-lokalise-api-2.8.0 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.7.0 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.6.1 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.6.0 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.5.0 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.4.0 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.3.0 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.2.0 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.1.1 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.1.0 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.0.1 lib/ruby-lokalise-api/rest/snapshots.rb
ruby-lokalise-api-2.0.0 lib/ruby-lokalise-api/rest/snapshots.rb