=begin #Mailchimp Marketing API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 3.0.54 Contact: apihelp@mailchimp.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.12 =end require 'uri' module MailchimpMarketing class EcommerceApi attr_accessor :api_client def initialize(api_client) @api_client = api_client end # Delete store def delete_store(store_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete cart def delete_store_cart(store_id, cart_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete cart line item def delete_cart_line_item(store_id, cart_id, line_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil? fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete customer def delete_store_customer(store_id, customer_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'customer_id'" if customer_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/customers/{customer_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'customer_id' + '}', customer_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete order def delete_order(store_id, order_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete order line item def delete_order_line_item(store_id, order_id, line_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil? fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete product def delete_store_product(store_id, product_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete product image def delete_product_image(store_id, product_id, image_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'image_id'" if image_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images/{image_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'image_id' + '}', image_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete product variant def delete_product_variant(store_id, product_id, variant_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'variant_id'" if variant_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants/{variant_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'variant_id' + '}', variant_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete promo code def delete_promo_code(store_id, promo_rule_id, promo_code_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil? fail ArgumentError, "Missing required param: 'promo_code_id'" if promo_code_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes/{promo_code_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s).sub('{' + 'promo_code_id' + '}', promo_code_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # Delete promo rule def delete_promo_rule(store_id, promo_rule_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil? query_params = {} post_body = nil local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s) data = @api_client.call_api(:DELETE, local_var_path, :query_params => query_params, :body => post_body) return data end # List account orders def orders(opts = {}) fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'campaign_id'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil? query_params[:'outreach_id'] = opts[:'outreach_id'] if !opts[:'outreach_id'].nil? query_params[:'customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil? query_params[:'has_outreach'] = opts[:'has_outreach'] if !opts[:'has_outreach'].nil? post_body = nil local_var_path = '/ecommerce/orders' data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List stores def stores(opts = {}) fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/ecommerce/stores' data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get store info def get_store(store_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List carts def get_store_carts(store_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/carts'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get cart info def get_store_cart(store_id, cart_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List cart line items def get_all_cart_line_items(store_id, cart_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get cart line item def get_cart_line_item(store_id, cart_id, line_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil? fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List customers def get_all_store_customers(store_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'email_address'] = opts[:'email_address'] if !opts[:'email_address'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/customers'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get customer info def get_store_customer(store_id, customer_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'customer_id'" if customer_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/customers/{customer_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'customer_id' + '}', customer_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List orders def get_store_orders(store_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil? query_params[:'has_outreach'] = opts[:'has_outreach'] if !opts[:'has_outreach'].nil? query_params[:'campaign_id'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil? query_params[:'outreach_id'] = opts[:'outreach_id'] if !opts[:'outreach_id'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/orders'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get order info def get_order(store_id, order_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List order line items def get_all_order_line_items(store_id, order_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get order line item def get_order_line_item(store_id, order_id, line_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil? fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List product def get_all_store_products(store_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/products'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get product info def get_store_product(store_id, product_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List product images def get_product_images(store_id, product_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get product image info def get_product_image(store_id, product_id, image_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'image_id'" if image_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images/{image_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'image_id' + '}', image_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List product variants def get_product_variants(store_id, product_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get product variant info def get_product_variant(store_id, product_id, variant_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'variant_id'" if variant_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants/{variant_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'variant_id' + '}', variant_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List promo codes def get_promo_codes(promo_rule_id, store_id, opts = {}) fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil? fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes'.sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s).sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get promo code def get_promo_code(store_id, promo_rule_id, promo_code_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil? fail ArgumentError, "Missing required param: 'promo_code_id'" if promo_code_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes/{promo_code_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s).sub('{' + 'promo_code_id' + '}', promo_code_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # List promo rules def list_promo_rules(store_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/promo-rules'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Get promo rule def get_promo_rule(store_id, promo_rule_id, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end # Update store def update_store(store_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update cart def update_store_cart(store_id, cart_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update cart line item def update_cart_line_item(store_id, cart_id, line_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil? fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update customer def update_store_customer(store_id, customer_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'customer_id'" if customer_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/customers/{customer_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'customer_id' + '}', customer_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update order def update_order(store_id, order_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update order line item def update_order_line_item(store_id, order_id, line_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil? fail ArgumentError, "Missing required param: 'line_id'" if line_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines/{line_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s).sub('{' + 'line_id' + '}', line_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update product def update_store_product(store_id, product_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update product image def update_product_image(store_id, product_id, image_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'image_id'" if image_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images/{image_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'image_id' + '}', image_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update product variant def update_product_variant(store_id, product_id, variant_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'variant_id'" if variant_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants/{variant_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'variant_id' + '}', variant_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update promo code def update_promo_code(store_id, promo_rule_id, promo_code_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil? fail ArgumentError, "Missing required param: 'promo_code_id'" if promo_code_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes/{promo_code_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s).sub('{' + 'promo_code_id' + '}', promo_code_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Update promo rule def update_promo_rule(store_id, promo_rule_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s) data = @api_client.call_api(:PATCH, local_var_path, :query_params => query_params, :body => post_body) return data end # Add store def add_store(body, opts = {}) fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores' data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add cart def add_store_cart(store_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/carts'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add cart line item def add_cart_line_item(store_id, cart_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'cart_id'" if cart_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/carts/{cart_id}/lines'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'cart_id' + '}', cart_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add customer def add_store_customer(store_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/customers'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add order def add_store_order(store_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/orders'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add order line item def add_order_line_item(store_id, order_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'order_id'" if order_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/orders/{order_id}/lines'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'order_id' + '}', order_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add product def add_store_product(store_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/products'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add product image def add_product_image(store_id, product_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/images'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add product variant def add_product_variants(store_id, product_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add promo code def add_promo_code(store_id, promo_rule_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'promo_rule_id'" if promo_rule_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/promo-rules/{promo_rule_id}/promo-codes'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'promo_rule_id' + '}', promo_rule_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add promo rule def add_promo_rules(store_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/promo-rules'.sub('{' + 'store_id' + '}', store_id.to_s) data = @api_client.call_api(:POST, local_var_path, :query_params => query_params, :body => post_body) return data end # Add or update customer def set_store_customer(store_id, customer_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'customer_id'" if customer_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/customers/{customer_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'customer_id' + '}', customer_id.to_s) data = @api_client.call_api(:PUT, local_var_path, :query_params => query_params, :body => post_body) return data end # Add or update product variant def add_product_variant(store_id, product_id, variant_id, body, opts = {}) fail ArgumentError, "Missing required param: 'store_id'" if store_id.nil? fail ArgumentError, "Missing required param: 'product_id'" if product_id.nil? fail ArgumentError, "Missing required param: 'variant_id'" if variant_id.nil? fail ArgumentError, "Missing required param: 'body'" if body.nil? query_params = {} post_body = @api_client.object_to_http_body(body) local_var_path = '/ecommerce/stores/{store_id}/products/{product_id}/variants/{variant_id}'.sub('{' + 'store_id' + '}', store_id.to_s).sub('{' + 'product_id' + '}', product_id.to_s).sub('{' + 'variant_id' + '}', variant_id.to_s) data = @api_client.call_api(:PUT, local_var_path, :query_params => query_params, :body => post_body) return data end end end