Sha256: 4794999668ae2c48fc62d41fcd3e02753bf6f3b0cb36a979b968f7d9eaa87ea3

Contents?: true

Size: 1.39 KB

Versions: 29

Compression:

Stored size: 1.39 KB

Contents

# frozen_string_literal: true

module MuffinMan
  module Feeds
    require "sp_api_helpers"
    class V20210630 < SpApiClient
      FEED_PATH = "/feeds/2021-06-30"

      def create_feed(feed_type, marketplace_ids, input_feed_document_id, params = {})
        @local_var_path = "#{FEED_PATH}/feeds"
        @request_body = { "feedType" => feed_type, "marketplaceIds" => marketplace_ids,
                          "inputFeedDocumentId" => input_feed_document_id }.merge(sp_api_params(params))
        @request_type = "POST"
        call_api
      end

      def get_feeds(params)
        @local_var_path = "#{FEED_PATH}/feeds"
        sp_api_params = sp_api_params(params)
        @query_params = sp_api_params.key?("nextToken") ? sp_api_params.slice("nextToken") : sp_api_params
        @request_type = "GET"
        call_api
      end

      def get_feed(feed_id)
        @local_var_path = "#{FEED_PATH}/feeds/#{feed_id}"
        @request_type = "GET"
        call_api
      end

      def create_feed_document(content_type, params = {})
        @local_var_path = "#{FEED_PATH}/documents"
        @request_body = { "contentType" => content_type }.merge(sp_api_params(params))
        @request_type = "POST"
        call_api
      end

      def get_feed_document(feed_document_id)
        @local_var_path = "#{FEED_PATH}/documents/#{feed_document_id}"
        @request_type = "GET"
        call_api
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
muffin_man-2.4.8 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.4.7 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.4.6 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.4.5 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.4.4 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.4.3 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.4.2 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.3.0 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.2.2 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.2.1 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.1.3 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.1.0 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.0.6 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.0.5 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.0.4 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.0.3 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.0.2 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.0.1 lib/muffin_man/feeds/v20210630.rb
muffin_man-2.0.0 lib/muffin_man/feeds/v20210630.rb
muffin_man-1.5.12 lib/muffin_man/feeds/v20210630.rb