=begin #Subskribe API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.41 =end require 'uri' module SubskribeDevClient class ProductCatalogApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Activate a plan # Marks a plan as active # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [PlanJson] def activate_plan(plan_id, opts = {}) data, _status_code, _headers = activate_plan_with_http_info(plan_id, opts) data end # Activate a plan # Marks a plan as active # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [Array<(PlanJson, Fixnum, Hash)>] PlanJson data, response status code and response headers def activate_plan_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.activate_plan ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.activate_plan" end # resource path local_var_path = '/plans/{planId}/activate'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#activate_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add charge to plan # Adds a charge to the specified plan. On success the id of the new charge is returned # @param plan_id id of the plan # @param body json representing the charge details # @param [Hash] opts the optional parameters # @return [ChargeJson] def add_charge(plan_id, body, opts = {}) data, _status_code, _headers = add_charge_with_http_info(plan_id, body, opts) data end # Add charge to plan # Adds a charge to the specified plan. On success the id of the new charge is returned # @param plan_id id of the plan # @param body json representing the charge details # @param [Hash] opts the optional parameters # @return [Array<(ChargeJson, Fixnum, Hash)>] ChargeJson data, response status code and response headers def add_charge_with_http_info(plan_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_charge ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.add_charge" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductCatalogApi.add_charge" end # resource path local_var_path = '/plans/{planId}/charges'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ChargeJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#add_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create percent of relationship # Creates a percent of relationship between a charge and plan. On success the id of the relationship is returned. # @param body json representing the relationship # @param [Hash] opts the optional parameters # @return [nil] def add_percent_of_plan_relationship(body, opts = {}) add_percent_of_plan_relationship_with_http_info(body, opts) nil end # Create percent of relationship # Creates a percent of relationship between a charge and plan. On success the id of the relationship is returned. # @param body json representing the relationship # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def add_percent_of_plan_relationship_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_percent_of_plan_relationship ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductCatalogApi.add_percent_of_plan_relationship" end # resource path local_var_path = '/plans/relationships/percentOf' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#add_percent_of_plan_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a plan # Creates a plan. On success the id of the new plan is returned. # @param body json of the plan details # @param [Hash] opts the optional parameters # @return [PlanJson] def add_plan(body, opts = {}) data, _status_code, _headers = add_plan_with_http_info(body, opts) data end # Create a plan # Creates a plan. On success the id of the new plan is returned. # @param body json of the plan details # @param [Hash] opts the optional parameters # @return [Array<(PlanJson, Fixnum, Hash)>] PlanJson data, response status code and response headers def add_plan_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_plan ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductCatalogApi.add_plan" end # resource path local_var_path = '/plans' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#add_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a product # Creates a product for your tenant. On success the id of the product is returned. # @param body product details json # @param [Hash] opts the optional parameters # @return [ProductJson] def add_product(body, opts = {}) data, _status_code, _headers = add_product_with_http_info(body, opts) data end # Create a product # Creates a product for your tenant. On success the id of the product is returned. # @param body product details json # @param [Hash] opts the optional parameters # @return [Array<(ProductJson, Fixnum, Hash)>] ProductJson data, response status code and response headers def add_product_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_product ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductCatalogApi.add_product" end # resource path local_var_path = '/products' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ProductJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#add_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a product category # Creates a product category. On success the id of the category is returned. # @param body product category details json # @param [Hash] opts the optional parameters # @return [ProductCategory] def add_product_category(body, opts = {}) data, _status_code, _headers = add_product_category_with_http_info(body, opts) data end # Create a product category # Creates a product category. On success the id of the category is returned. # @param body product category details json # @param [Hash] opts the optional parameters # @return [Array<(ProductCategory, Fixnum, Hash)>] ProductCategory data, response status code and response headers def add_product_category_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_product_category ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductCatalogApi.add_product_category" end # resource path local_var_path = '/product/categories' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ProductCategory') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#add_product_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Revert a plan to draft # Marks a plan as draft # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [PlanJson] def deactivate_plan(plan_id, opts = {}) data, _status_code, _headers = deactivate_plan_with_http_info(plan_id, opts) data end # Revert a plan to draft # Marks a plan as draft # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [Array<(PlanJson, Fixnum, Hash)>] PlanJson data, response status code and response headers def deactivate_plan_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.deactivate_plan ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.deactivate_plan" end # resource path local_var_path = '/plans/{planId}/revertToDraft'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#deactivate_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a catalog relationship # Deletes the specified catalog relationship # @param relationship_id id of the relationship # @param [Hash] opts the optional parameters # @return [CatalogRelationship] def delete_catalog_relationship_by_id(relationship_id, opts = {}) data, _status_code, _headers = delete_catalog_relationship_by_id_with_http_info(relationship_id, opts) data end # Delete a catalog relationship # Deletes the specified catalog relationship # @param relationship_id id of the relationship # @param [Hash] opts the optional parameters # @return [Array<(CatalogRelationship, Fixnum, Hash)>] CatalogRelationship data, response status code and response headers def delete_catalog_relationship_by_id_with_http_info(relationship_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.delete_catalog_relationship_by_id ...' end # verify the required parameter 'relationship_id' is set if @api_client.config.client_side_validation && relationship_id.nil? fail ArgumentError, "Missing the required parameter 'relationship_id' when calling ProductCatalogApi.delete_catalog_relationship_by_id" end # resource path local_var_path = '/plans/relationships/{relationshipId}'.sub('{' + 'relationshipId' + '}', relationship_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CatalogRelationship') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#delete_catalog_relationship_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a charge # Removes a charge from a plan. # @param plan_id id of the plan # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @return [ChargeJson] def delete_charge(plan_id, charge_id, opts = {}) data, _status_code, _headers = delete_charge_with_http_info(plan_id, charge_id, opts) data end # Delete a charge # Removes a charge from a plan. # @param plan_id id of the plan # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @return [Array<(ChargeJson, Fixnum, Hash)>] ChargeJson data, response status code and response headers def delete_charge_with_http_info(plan_id, charge_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.delete_charge ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.delete_charge" end # verify the required parameter 'charge_id' is set if @api_client.config.client_side_validation && charge_id.nil? fail ArgumentError, "Missing the required parameter 'charge_id' when calling ProductCatalogApi.delete_charge" end # resource path local_var_path = '/plans/{planId}/charges/{chargeId}'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ChargeJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#delete_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a plan # Deletes a plan. Note you can't delete a plan that's in use. # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [PlanJson] def delete_plan(plan_id, opts = {}) data, _status_code, _headers = delete_plan_with_http_info(plan_id, opts) data end # Delete a plan # Deletes a plan. Note you can't delete a plan that's in use. # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [Array<(PlanJson, Fixnum, Hash)>] PlanJson data, response status code and response headers def delete_plan_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.delete_plan ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.delete_plan" end # resource path local_var_path = '/plans/{planId}'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#delete_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a product # Delete the specified product. # @param id id of the product # @param [Hash] opts the optional parameters # @return [ProductJson] def delete_product(id, opts = {}) data, _status_code, _headers = delete_product_with_http_info(id, opts) data end # Delete a product # Delete the specified product. # @param id id of the product # @param [Hash] opts the optional parameters # @return [Array<(ProductJson, Fixnum, Hash)>] ProductJson data, response status code and response headers def delete_product_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.delete_product ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ProductCatalogApi.delete_product" end # resource path local_var_path = '/products/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ProductJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#delete_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a product category # Deletes the specified product category. Note that a product category can't be delete once it's in use. # @param id id of the category # @param [Hash] opts the optional parameters # @return [ProductCategory] def delete_product_category(id, opts = {}) data, _status_code, _headers = delete_product_category_with_http_info(id, opts) data end # Delete a product category # Deletes the specified product category. Note that a product category can't be delete once it's in use. # @param id id of the category # @param [Hash] opts the optional parameters # @return [Array<(ProductCategory, Fixnum, Hash)>] ProductCategory data, response status code and response headers def delete_product_category_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.delete_product_category ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ProductCatalogApi.delete_product_category" end # resource path local_var_path = '/product/categories/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ProductCategory') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#delete_product_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deprecate a plan # Marks a plan as deprecated. Once deprecated a plan may not be attached to new orders. # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [PlanJson] def deprecate_plan(plan_id, opts = {}) data, _status_code, _headers = deprecate_plan_with_http_info(plan_id, opts) data end # Deprecate a plan # Marks a plan as deprecated. Once deprecated a plan may not be attached to new orders. # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [Array<(PlanJson, Fixnum, Hash)>] PlanJson data, response status code and response headers def deprecate_plan_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.deprecate_plan ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.deprecate_plan" end # resource path local_var_path = '/plans/{planId}/deprecate'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#deprecate_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Duplicate a plan # Duplicates the specified plan. On success the new plan id is returned. # @param plan_id id of the plan to duplicate # @param [Hash] opts the optional parameters # @return [PlanJson] def duplicate_plan(plan_id, opts = {}) data, _status_code, _headers = duplicate_plan_with_http_info(plan_id, opts) data end # Duplicate a plan # Duplicates the specified plan. On success the new plan id is returned. # @param plan_id id of the plan to duplicate # @param [Hash] opts the optional parameters # @return [Array<(PlanJson, Fixnum, Hash)>] PlanJson data, response status code and response headers def duplicate_plan_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.duplicate_plan ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.duplicate_plan" end # resource path local_var_path = '/plans/{planId}/duplicate'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#duplicate_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Export product catalog # Export the product catalog in CSV format. # @param [Hash] opts the optional parameters # @return [nil] def export_product_catalog(opts = {}) export_product_catalog_with_http_info(opts) nil end # Export product catalog # Export the product catalog in CSV format. # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def export_product_catalog_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.export_product_catalog ...' end # resource path local_var_path = '/products/export' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#export_product_catalog\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get relationship details # Gets the details of the specified catalog relationship. # @param relationship_id id of the relationship # @param [Hash] opts the optional parameters # @return [CatalogRelationship] def get_catalog_relationship_by_id(relationship_id, opts = {}) data, _status_code, _headers = get_catalog_relationship_by_id_with_http_info(relationship_id, opts) data end # Get relationship details # Gets the details of the specified catalog relationship. # @param relationship_id id of the relationship # @param [Hash] opts the optional parameters # @return [Array<(CatalogRelationship, Fixnum, Hash)>] CatalogRelationship data, response status code and response headers def get_catalog_relationship_by_id_with_http_info(relationship_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_catalog_relationship_by_id ...' end # verify the required parameter 'relationship_id' is set if @api_client.config.client_side_validation && relationship_id.nil? fail ArgumentError, "Missing the required parameter 'relationship_id' when calling ProductCatalogApi.get_catalog_relationship_by_id" end # resource path local_var_path = '/plans/relationships/{relationshipId}'.sub('{' + 'relationshipId' + '}', relationship_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CatalogRelationship') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_catalog_relationship_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get charge details # Gets the details of the specified charge on the specified plan. # @param plan_id id of the plan # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @return [ChargeJson] def get_charge(plan_id, charge_id, opts = {}) data, _status_code, _headers = get_charge_with_http_info(plan_id, charge_id, opts) data end # Get charge details # Gets the details of the specified charge on the specified plan. # @param plan_id id of the plan # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @return [Array<(ChargeJson, Fixnum, Hash)>] ChargeJson data, response status code and response headers def get_charge_with_http_info(plan_id, charge_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_charge ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.get_charge" end # verify the required parameter 'charge_id' is set if @api_client.config.client_side_validation && charge_id.nil? fail ArgumentError, "Missing the required parameter 'charge_id' when calling ProductCatalogApi.get_charge" end # resource path local_var_path = '/plans/{planId}/charges/{chargeId}'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ChargeJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get ledger accounts # Gets the ledger accounts mapped to the specified charge # @param plan_id id of the plan # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @return [Array] def get_charge_ledger_accounts(plan_id, charge_id, opts = {}) data, _status_code, _headers = get_charge_ledger_accounts_with_http_info(plan_id, charge_id, opts) data end # Get ledger accounts # Gets the ledger accounts mapped to the specified charge # @param plan_id id of the plan # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_charge_ledger_accounts_with_http_info(plan_id, charge_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_charge_ledger_accounts ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.get_charge_ledger_accounts" end # verify the required parameter 'charge_id' is set if @api_client.config.client_side_validation && charge_id.nil? fail ArgumentError, "Missing the required parameter 'charge_id' when calling ProductCatalogApi.get_charge_ledger_accounts" end # resource path local_var_path = '/plans/{planId}/charges/{chargeId}/ledgerAccounts'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_charge_ledger_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get percent of relationships for a plan # Gets the percent of relationships for the specified plan. # @param from_plan_id id of the plan # @param [Hash] opts the optional parameters # @return [Array] def get_percent_of_relationships(from_plan_id, opts = {}) data, _status_code, _headers = get_percent_of_relationships_with_http_info(from_plan_id, opts) data end # Get percent of relationships for a plan # Gets the percent of relationships for the specified plan. # @param from_plan_id id of the plan # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_percent_of_relationships_with_http_info(from_plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_percent_of_relationships ...' end # verify the required parameter 'from_plan_id' is set if @api_client.config.client_side_validation && from_plan_id.nil? fail ArgumentError, "Missing the required parameter 'from_plan_id' when calling ProductCatalogApi.get_percent_of_relationships" end # resource path local_var_path = '/plans/relationships/percentOf' # query parameters query_params = {} query_params[:'fromPlanId'] = from_plan_id # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_percent_of_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get plan details # Returns the details of the specified plan. # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [PlanJson] def get_plan(plan_id, opts = {}) data, _status_code, _headers = get_plan_with_http_info(plan_id, opts) data end # Get plan details # Returns the details of the specified plan. # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [Array<(PlanJson, Fixnum, Hash)>] PlanJson data, response status code and response headers def get_plan_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_plan ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.get_plan" end # resource path local_var_path = '/plans/{planId}'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get plans # Returns all plans for a product. The result is paginated. To retrieve all results pass the cursor returned from a call to the next call until all results are returned. # @param [Hash] opts the optional parameters # @option opts [String] :product_id id of the product # @option opts [String] :status filter by plan status # @option opts [String] :cursor cursor from the last call # @option opts [Integer] :limit number of results per page # @return [PlanJsonPaginationResponse] def get_plans(opts = {}) data, _status_code, _headers = get_plans_with_http_info(opts) data end # Get plans # Returns all plans for a product. The result is paginated. To retrieve all results pass the cursor returned from a call to the next call until all results are returned. # @param [Hash] opts the optional parameters # @option opts [String] :product_id id of the product # @option opts [String] :status filter by plan status # @option opts [String] :cursor cursor from the last call # @option opts [Integer] :limit number of results per page # @return [Array<(PlanJsonPaginationResponse, Fixnum, Hash)>] PlanJsonPaginationResponse data, response status code and response headers def get_plans_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_plans ...' end if @api_client.config.client_side_validation && opts[:'status'] && !['DRAFT', 'ACTIVE', 'GRANDFATHERED', 'ARCHIVED', 'DEPRECATED'].include?(opts[:'status']) fail ArgumentError, 'invalid value for "status", must be one of DRAFT, ACTIVE, GRANDFATHERED, ARCHIVED, DEPRECATED' end # resource path local_var_path = '/plans' # query parameters query_params = {} query_params[:'productId'] = opts[:'product_id'] if !opts[:'product_id'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJsonPaginationResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get product details. # Gets the details of the specified product. # @param id id of the product # @param [Hash] opts the optional parameters # @return [ProductJson] def get_product(id, opts = {}) data, _status_code, _headers = get_product_with_http_info(id, opts) data end # Get product details. # Gets the details of the specified product. # @param id id of the product # @param [Hash] opts the optional parameters # @return [Array<(ProductJson, Fixnum, Hash)>] ProductJson data, response status code and response headers def get_product_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_product ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ProductCatalogApi.get_product" end # resource path local_var_path = '/products/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ProductJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get product Categories # Gets all product categories for your tenant. The results are paginated. To fetch all results pass the cursor returned from a call to the subsequent calls until all results are returned. Initially the cursor should not be specified. # @param [Hash] opts the optional parameters # @option opts [String] :cursor cursor from prior call # @option opts [Integer] :limit number of results per page # @return [ProductCategoryPaginationResponse] def get_product_categories(opts = {}) data, _status_code, _headers = get_product_categories_with_http_info(opts) data end # Get product Categories # Gets all product categories for your tenant. The results are paginated. To fetch all results pass the cursor returned from a call to the subsequent calls until all results are returned. Initially the cursor should not be specified. # @param [Hash] opts the optional parameters # @option opts [String] :cursor cursor from prior call # @option opts [Integer] :limit number of results per page # @return [Array<(ProductCategoryPaginationResponse, Fixnum, Hash)>] ProductCategoryPaginationResponse data, response status code and response headers def get_product_categories_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_product_categories ...' end # resource path local_var_path = '/product/categories' # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ProductCategoryPaginationResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_product_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get product category details # Gets the details of the specified product category # @param id id of the category # @param [Hash] opts the optional parameters # @return [ProductCategory] def get_product_category(id, opts = {}) data, _status_code, _headers = get_product_category_with_http_info(id, opts) data end # Get product category details # Gets the details of the specified product category # @param id id of the category # @param [Hash] opts the optional parameters # @return [Array<(ProductCategory, Fixnum, Hash)>] ProductCategory data, response status code and response headers def get_product_category_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_product_category ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ProductCatalogApi.get_product_category" end # resource path local_var_path = '/product/categories/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ProductCategory') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_product_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get products # Returns all products for your tenant. The results on paginated. To fetch them all pass the cursor returned from a call to the subsequent call until all results are fetched. Initially the cursor should not be specified. # @param [Hash] opts the optional parameters # @option opts [String] :cursor cursor received from prior call # @option opts [Integer] :limit number of results per page # @return [ProductJsonPaginationResponse] def get_products(opts = {}) data, _status_code, _headers = get_products_with_http_info(opts) data end # Get products # Returns all products for your tenant. The results on paginated. To fetch them all pass the cursor returned from a call to the subsequent call until all results are fetched. Initially the cursor should not be specified. # @param [Hash] opts the optional parameters # @option opts [String] :cursor cursor received from prior call # @option opts [Integer] :limit number of results per page # @return [Array<(ProductJsonPaginationResponse, Fixnum, Hash)>] ProductJsonPaginationResponse data, response status code and response headers def get_products_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_products ...' end # resource path local_var_path = '/products' # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ProductJsonPaginationResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get percent of target plans # Gets the list of percent of charge target plans. # @param plan_id # @param [Hash] opts the optional parameters # @return [CatalogRelationship] def get_target_plans_for_percent_of_plan_id(plan_id, opts = {}) data, _status_code, _headers = get_target_plans_for_percent_of_plan_id_with_http_info(plan_id, opts) data end # Get percent of target plans # Gets the list of percent of charge target plans. # @param plan_id # @param [Hash] opts the optional parameters # @return [Array<(CatalogRelationship, Fixnum, Hash)>] CatalogRelationship data, response status code and response headers def get_target_plans_for_percent_of_plan_id_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_target_plans_for_percent_of_plan_id ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.get_target_plans_for_percent_of_plan_id" end # resource path local_var_path = '/plans/relationships/percentOf/{planId}'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CatalogRelationship') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#get_target_plans_for_percent_of_plan_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Map ledger accounts # Map ledger accounts to the specified charge for the specified plan. # @param plan_id id of the plan # @param charge_id id of the charge # @param body list of the ledger account ids # @param [Hash] opts the optional parameters # @return [Array] def map_ledger_accounts_to_charge(plan_id, charge_id, body, opts = {}) data, _status_code, _headers = map_ledger_accounts_to_charge_with_http_info(plan_id, charge_id, body, opts) data end # Map ledger accounts # Map ledger accounts to the specified charge for the specified plan. # @param plan_id id of the plan # @param charge_id id of the charge # @param body list of the ledger account ids # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def map_ledger_accounts_to_charge_with_http_info(plan_id, charge_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.map_ledger_accounts_to_charge ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.map_ledger_accounts_to_charge" end # verify the required parameter 'charge_id' is set if @api_client.config.client_side_validation && charge_id.nil? fail ArgumentError, "Missing the required parameter 'charge_id' when calling ProductCatalogApi.map_ledger_accounts_to_charge" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductCatalogApi.map_ledger_accounts_to_charge" end # resource path local_var_path = '/plans/{planId}/charges/{chargeId}/ledgerAccounts'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#map_ledger_accounts_to_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update non-financial charge details # Updates certain details of the specified charge which won't impact its financial treatment # @param plan_id id of the plan # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @option opts [ChargePartialJson] :body # @return [ChargeJson] def patch_charge(plan_id, charge_id, opts = {}) data, _status_code, _headers = patch_charge_with_http_info(plan_id, charge_id, opts) data end # Update non-financial charge details # Updates certain details of the specified charge which won't impact its financial treatment # @param plan_id id of the plan # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @option opts [ChargePartialJson] :body # @return [Array<(ChargeJson, Fixnum, Hash)>] ChargeJson data, response status code and response headers def patch_charge_with_http_info(plan_id, charge_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.patch_charge ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.patch_charge" end # verify the required parameter 'charge_id' is set if @api_client.config.client_side_validation && charge_id.nil? fail ArgumentError, "Missing the required parameter 'charge_id' when calling ProductCatalogApi.patch_charge" end # resource path local_var_path = '/plans/{planId}/charges/{chargeId}/partial'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ChargeJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#patch_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Reactivate a plan # Reactivates a deprecated plan. # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [PlanJson] def reactivate_plan(plan_id, opts = {}) data, _status_code, _headers = reactivate_plan_with_http_info(plan_id, opts) data end # Reactivate a plan # Reactivates a deprecated plan. # @param plan_id id of the plan # @param [Hash] opts the optional parameters # @return [Array<(PlanJson, Fixnum, Hash)>] PlanJson data, response status code and response headers def reactivate_plan_with_http_info(plan_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.reactivate_plan ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.reactivate_plan" end # resource path local_var_path = '/plans/{planId}/reactivate'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#reactivate_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update charge details # Updates the details of the specified charge on the specified plan. # @param plan_id id of the plan associated with the charge # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @option opts [ChargeJson] :body # @return [nil] def update_charge(plan_id, charge_id, opts = {}) update_charge_with_http_info(plan_id, charge_id, opts) nil end # Update charge details # Updates the details of the specified charge on the specified plan. # @param plan_id id of the plan associated with the charge # @param charge_id id of the charge # @param [Hash] opts the optional parameters # @option opts [ChargeJson] :body # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_charge_with_http_info(plan_id, charge_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.update_charge ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.update_charge" end # verify the required parameter 'charge_id' is set if @api_client.config.client_side_validation && charge_id.nil? fail ArgumentError, "Missing the required parameter 'charge_id' when calling ProductCatalogApi.update_charge" end # resource path local_var_path = '/plans/{planId}/charges/{chargeId}'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#update_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update plan # Updates the details of the specified plan. Note you can't update the details of a plan once it's in use. # @param plan_id id of the plan # @param body json of the plan details # @param [Hash] opts the optional parameters # @return [PlanJson] def update_plan(plan_id, body, opts = {}) data, _status_code, _headers = update_plan_with_http_info(plan_id, body, opts) data end # Update plan # Updates the details of the specified plan. Note you can't update the details of a plan once it's in use. # @param plan_id id of the plan # @param body json of the plan details # @param [Hash] opts the optional parameters # @return [Array<(PlanJson, Fixnum, Hash)>] PlanJson data, response status code and response headers def update_plan_with_http_info(plan_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.update_plan ...' end # verify the required parameter 'plan_id' is set if @api_client.config.client_side_validation && plan_id.nil? fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.update_plan" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductCatalogApi.update_plan" end # resource path local_var_path = '/plans/{planId}'.sub('{' + 'planId' + '}', plan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PlanJson') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#update_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update product details # Updates the details of the specified product # @param id id of the product # @param body product details json # @param [Hash] opts the optional parameters # @return [nil] def update_product(id, body, opts = {}) update_product_with_http_info(id, body, opts) nil end # Update product details # Updates the details of the specified product # @param id id of the product # @param body product details json # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_product_with_http_info(id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.update_product ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ProductCatalogApi.update_product" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductCatalogApi.update_product" end # resource path local_var_path = '/products/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#update_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update product category details # Updates the details of a product category # @param id id of the category # @param body product category details json # @param [Hash] opts the optional parameters # @return [nil] def update_product_category(id, body, opts = {}) update_product_category_with_http_info(id, body, opts) nil end # Update product category details # Updates the details of a product category # @param id id of the category # @param body product category details json # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_product_category_with_http_info(id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProductCatalogApi.update_product_category ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ProductCatalogApi.update_product_category" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ProductCatalogApi.update_product_category" end # resource path local_var_path = '/product/categories/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['ApiKeyAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProductCatalogApi#update_product_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end