Sha256: f2024c17d4a5d402beb235485a93222f85f95f0ecf71ed66065e015e64d39ab3

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

# encoding: UTF-8
# frozen_string_literal: true
#
# Copyright (c) 2010-2021 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

module GoodData
  class DatasetMapping
    DATASET_MAPPING_GET_URI = '/gdc/dataload/projects/%<project_id>s/modelMapping/datasets'
    DATASET_MAPPING_UPDATE_URI = '/gdc/dataload/projects/%<project_id>s/modelMapping/datasets/bulk/upsert'

    class << self
      def [](opts = { :client => GoodData.connection, :project => GoodData.project })
        client, project = GoodData.get_client_and_project(opts)
        get_uri = DATASET_MAPPING_GET_URI % { project_id: project.pid }
        res = client.get(get_uri)
        res
      end

      alias_method :get, :[]
    end

    def initialize(data)
      @data = data
    end

    def save(opts)
      client, project = GoodData.get_client_and_project(opts)

      post_uri = DATASET_MAPPING_UPDATE_URI % { project_id: project.pid }
      res = client.post(post_uri, @data, opts)
      res
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gooddata-2.3.1-java lib/gooddata/models/dataset_mapping.rb
gooddata-2.3.1 lib/gooddata/models/dataset_mapping.rb
gooddata-2.3.0-java lib/gooddata/models/dataset_mapping.rb
gooddata-2.3.0 lib/gooddata/models/dataset_mapping.rb
gooddata-2.2.0-java lib/gooddata/models/dataset_mapping.rb
gooddata-2.2.0 lib/gooddata/models/dataset_mapping.rb