=begin #Klaviyo API #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details. The version of the OpenAPI document: 2022-10-17 Contact: developers@klaviyo.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.1 =end require 'cgi' module KlaviyoAPI class CatalogsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create Catalog Category # Create a new catalog category.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_category_create_query [CatalogCategoryCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def create_catalog_category(catalog_category_create_query, opts = {}) data, _status_code, _headers = create_catalog_category_with_http_info(catalog_category_create_query, opts) data end # Create Catalog Category # Create a new catalog category.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_category_create_query [CatalogCategoryCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def create_catalog_category_with_http_info(catalog_category_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_category ...' end # verify the required parameter 'catalog_category_create_query' is set if @api_client.config.client_side_validation && catalog_category_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_category_create_query' when calling CatalogsApi.create_catalog_category" end # resource path local_var_path = '/api/catalog-categories/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.create_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Catalog Category Relationships # Create a new item relationship for the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters # @return [nil] def create_catalog_category_relationships(id, related_resource, catalog_category_item_op, opts = {}) create_catalog_category_relationships_with_http_info(id, related_resource, catalog_category_item_op, opts) nil end # Create Catalog Category Relationships # Create a new item relationship for the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def create_catalog_category_relationships_with_http_info(id, related_resource, catalog_category_item_op, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_category_relationships ...' 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 CatalogsApi.create_catalog_category_relationships" end # verify the required parameter 'related_resource' is set if @api_client.config.client_side_validation && related_resource.nil? fail ArgumentError, "Missing the required parameter 'related_resource' when calling CatalogsApi.create_catalog_category_relationships" end # verify enum value allowable_values = ["items"] if @api_client.config.client_side_validation && !allowable_values.include?(related_resource) fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}" end # verify the required parameter 'catalog_category_item_op' is set if @api_client.config.client_side_validation && catalog_category_item_op.nil? fail ArgumentError, "Missing the required parameter 'catalog_category_item_op' when calling CatalogsApi.create_catalog_category_relationships" end # resource path local_var_path = '/api/catalog-categories/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_item_op) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.create_catalog_category_relationships", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_category_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Catalog Item # Create a new catalog item.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_item_create_query [CatalogItemCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def create_catalog_item(catalog_item_create_query, opts = {}) data, _status_code, _headers = create_catalog_item_with_http_info(catalog_item_create_query, opts) data end # Create Catalog Item # Create a new catalog item.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_item_create_query [CatalogItemCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def create_catalog_item_with_http_info(catalog_item_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_item ...' end # verify the required parameter 'catalog_item_create_query' is set if @api_client.config.client_side_validation && catalog_item_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_item_create_query' when calling CatalogsApi.create_catalog_item" end # resource path local_var_path = '/api/catalog-items/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.create_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Catalog Item Relationships # Create a new catalog category relationship for the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [nil] def create_catalog_item_relationships(id, related_resource, catalog_item_category_op, opts = {}) create_catalog_item_relationships_with_http_info(id, related_resource, catalog_item_category_op, opts) nil end # Create Catalog Item Relationships # Create a new catalog category relationship for the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def create_catalog_item_relationships_with_http_info(id, related_resource, catalog_item_category_op, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_item_relationships ...' 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 CatalogsApi.create_catalog_item_relationships" end # verify the required parameter 'related_resource' is set if @api_client.config.client_side_validation && related_resource.nil? fail ArgumentError, "Missing the required parameter 'related_resource' when calling CatalogsApi.create_catalog_item_relationships" end # verify enum value allowable_values = ["categories"] if @api_client.config.client_side_validation && !allowable_values.include?(related_resource) fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}" end # verify the required parameter 'catalog_item_category_op' is set if @api_client.config.client_side_validation && catalog_item_category_op.nil? fail ArgumentError, "Missing the required parameter 'catalog_item_category_op' when calling CatalogsApi.create_catalog_item_relationships" end # resource path local_var_path = '/api/catalog-items/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_category_op) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.create_catalog_item_relationships", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_item_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Catalog Variant # Create a new variant for a related catalog item.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_variant_create_query [CatalogVariantCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def create_catalog_variant(catalog_variant_create_query, opts = {}) data, _status_code, _headers = create_catalog_variant_with_http_info(catalog_variant_create_query, opts) data end # Create Catalog Variant # Create a new variant for a related catalog item.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_variant_create_query [CatalogVariantCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def create_catalog_variant_with_http_info(catalog_variant_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.create_catalog_variant ...' end # verify the required parameter 'catalog_variant_create_query' is set if @api_client.config.client_side_validation && catalog_variant_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_variant_create_query' when calling CatalogsApi.create_catalog_variant" end # resource path local_var_path = '/api/catalog-variants/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.create_catalog_variant", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#create_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Catalog Category # Delete a catalog category using the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param [Hash] opts the optional parameters # @return [nil] def delete_catalog_category(id, opts = {}) delete_catalog_category_with_http_info(id, opts) nil end # Delete Catalog Category # Delete a catalog category using the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_catalog_category_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_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 CatalogsApi.delete_catalog_category" end # resource path local_var_path = '/api/catalog-categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.delete_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Catalog Category Relationships # Delete item relationships for the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters # @return [nil] def delete_catalog_category_relationships(id, related_resource, catalog_category_item_op, opts = {}) delete_catalog_category_relationships_with_http_info(id, related_resource, catalog_category_item_op, opts) nil end # Delete Catalog Category Relationships # Delete item relationships for the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_catalog_category_relationships_with_http_info(id, related_resource, catalog_category_item_op, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_category_relationships ...' 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 CatalogsApi.delete_catalog_category_relationships" end # verify the required parameter 'related_resource' is set if @api_client.config.client_side_validation && related_resource.nil? fail ArgumentError, "Missing the required parameter 'related_resource' when calling CatalogsApi.delete_catalog_category_relationships" end # verify enum value allowable_values = ["items"] if @api_client.config.client_side_validation && !allowable_values.include?(related_resource) fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}" end # verify the required parameter 'catalog_category_item_op' is set if @api_client.config.client_side_validation && catalog_category_item_op.nil? fail ArgumentError, "Missing the required parameter 'catalog_category_item_op' when calling CatalogsApi.delete_catalog_category_relationships" end # resource path local_var_path = '/api/catalog-categories/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_item_op) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.delete_catalog_category_relationships", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_category_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Catalog Item # Delete a catalog item with the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param [Hash] opts the optional parameters # @return [nil] def delete_catalog_item(id, opts = {}) delete_catalog_item_with_http_info(id, opts) nil end # Delete Catalog Item # Delete a catalog item with the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_catalog_item_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_item ...' 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 CatalogsApi.delete_catalog_item" end # resource path local_var_path = '/api/catalog-items/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.delete_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Catalog Item Relationships # Delete catalog category relationships for the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [nil] def delete_catalog_item_relationships(id, related_resource, catalog_item_category_op, opts = {}) delete_catalog_item_relationships_with_http_info(id, related_resource, catalog_item_category_op, opts) nil end # Delete Catalog Item Relationships # Delete catalog category relationships for the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_catalog_item_relationships_with_http_info(id, related_resource, catalog_item_category_op, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_item_relationships ...' 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 CatalogsApi.delete_catalog_item_relationships" end # verify the required parameter 'related_resource' is set if @api_client.config.client_side_validation && related_resource.nil? fail ArgumentError, "Missing the required parameter 'related_resource' when calling CatalogsApi.delete_catalog_item_relationships" end # verify enum value allowable_values = ["categories"] if @api_client.config.client_side_validation && !allowable_values.include?(related_resource) fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}" end # verify the required parameter 'catalog_item_category_op' is set if @api_client.config.client_side_validation && catalog_item_category_op.nil? fail ArgumentError, "Missing the required parameter 'catalog_item_category_op' when calling CatalogsApi.delete_catalog_item_relationships" end # resource path local_var_path = '/api/catalog-items/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_category_op) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.delete_catalog_item_relationships", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_item_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Catalog Variant # Delete a catalog item variant with the given variant ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param [Hash] opts the optional parameters # @return [nil] def delete_catalog_variant(id, opts = {}) delete_catalog_variant_with_http_info(id, opts) nil end # Delete Catalog Variant # Delete a catalog item variant with the given variant ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_catalog_variant_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.delete_catalog_variant ...' 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 CatalogsApi.delete_catalog_variant" end # resource path local_var_path = '/api/catalog-variants/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.delete_catalog_variant", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#delete_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Categories # Get all catalog categories in an account. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Use filters to return specific fields. Request specific fields [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 100 categories per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item`: `equals`<br>`name`: `contains` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Hash] def get_catalog_categories(opts = {}) data, _status_code, _headers = get_catalog_categories_with_http_info(opts) data end # Get Catalog Categories # Get all catalog categories in an account. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Use filters to return specific fields. Request specific fields [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 100 categories per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item`: `equals`<br>`name`: `contains` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_categories_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_categories ...' end allowable_values = ["external_id", "name", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" end allowable_values = ["created", "-created"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-categories/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_categories", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Category # Get a catalog category with the given category ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Hash] def get_catalog_category(id, opts = {}) data, _status_code, _headers = get_catalog_category_with_http_info(id, opts) data end # Get Catalog Category # Get a catalog category with the given category ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_category_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_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 CatalogsApi.get_catalog_category" end allowable_values = ["external_id", "name", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Category Items # Get all items in a category with the given category ID. Items can be sorted by the following fields, in ascending and descending order: `created` Use filters to return specific fields and any variants. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `variants` Returns a maximum of 100 items per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param category_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category`: `equals`<br>`title`: `contains`<br>`published`: `equals` # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Hash] def get_catalog_category_items(category_id, opts = {}) data, _status_code, _headers = get_catalog_category_items_with_http_info(category_id, opts) data end # Get Catalog Category Items # Get all items in a category with the given category ID. Items can be sorted by the following fields, in ascending and descending order: `created` Use filters to return specific fields and any variants. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `variants` Returns a maximum of 100 items per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param category_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category`: `equals`<br>`title`: `contains`<br>`published`: `equals` # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_category_items_with_http_info(category_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_category_items ...' end # verify the required parameter 'category_id' is set if @api_client.config.client_side_validation && category_id.nil? fail ArgumentError, "Missing the required parameter 'category_id' when calling CatalogsApi.get_catalog_category_items" end allowable_values = ["external_id", "title", "description", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" end allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end allowable_values = ["variants"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end allowable_values = ["created", "-created"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-categories/{category_id}/items/'.sub('{' + 'category_id' + '}', CGI.escape(category_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_category_items", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_category_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Category Relationships # Get all items in the given category ID. Returns a maximum of 100 items per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param related_resource [String] # @param [Hash] opts the optional parameters # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_catalog_category_relationships(id, related_resource, opts = {}) data, _status_code, _headers = get_catalog_category_relationships_with_http_info(id, related_resource, opts) data end # Get Catalog Category Relationships # Get all items in the given category ID. Returns a maximum of 100 items per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param related_resource [String] # @param [Hash] opts the optional parameters # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_category_relationships_with_http_info(id, related_resource, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_category_relationships ...' 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 CatalogsApi.get_catalog_category_relationships" end # verify the required parameter 'related_resource' is set if @api_client.config.client_side_validation && related_resource.nil? fail ArgumentError, "Missing the required parameter 'related_resource' when calling CatalogsApi.get_catalog_category_relationships" end # verify enum value allowable_values = ["items"] if @api_client.config.client_side_validation && !allowable_values.include?(related_resource) fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-categories/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_category_relationships", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_category_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Item # Get a specific catalog item with the given item ID. Request specific fields and variants using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `variants`

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Hash] def get_catalog_item(id, opts = {}) data, _status_code, _headers = get_catalog_item_with_http_info(id, opts) data end # Get Catalog Item # Get a specific catalog item with the given item ID. Request specific fields and variants using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `variants`<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_item_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_item ...' 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 CatalogsApi.get_catalog_item" end allowable_values = ["external_id", "title", "description", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" end allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end allowable_values = ["variants"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-items/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Item Categories # Get all catalog categories that an item with the given item ID is in. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Use filters to return specific fields. Request specific fields [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 100 categories per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param item_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item`: `equals`<br>`name`: `contains` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Hash] def get_catalog_item_categories(item_id, opts = {}) data, _status_code, _headers = get_catalog_item_categories_with_http_info(item_id, opts) data end # Get Catalog Item Categories # Get all catalog categories that an item with the given item ID is in. Catalog categories can be sorted by the following fields, in ascending and descending order: `created` Use filters to return specific fields. Request specific fields [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 100 categories per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param item_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item`: `equals`<br>`name`: `contains` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_item_categories_with_http_info(item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_item_categories ...' end # verify the required parameter 'item_id' is set if @api_client.config.client_side_validation && item_id.nil? fail ArgumentError, "Missing the required parameter 'item_id' when calling CatalogsApi.get_catalog_item_categories" end allowable_values = ["external_id", "name", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" end allowable_values = ["created", "-created"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-items/{item_id}/categories/'.sub('{' + 'item_id' + '}', CGI.escape(item_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_item_categories", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_item_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Item Relationships # Get all catalog categories that a particular item is in. Returns a maximum of 100 categories per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param related_resource [String] # @param [Hash] opts the optional parameters # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_catalog_item_relationships(id, related_resource, opts = {}) data, _status_code, _headers = get_catalog_item_relationships_with_http_info(id, related_resource, opts) data end # Get Catalog Item Relationships # Get all catalog categories that a particular item is in. Returns a maximum of 100 categories per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param related_resource [String] # @param [Hash] opts the optional parameters # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_item_relationships_with_http_info(id, related_resource, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_item_relationships ...' 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 CatalogsApi.get_catalog_item_relationships" end # verify the required parameter 'related_resource' is set if @api_client.config.client_side_validation && related_resource.nil? fail ArgumentError, "Missing the required parameter 'related_resource' when calling CatalogsApi.get_catalog_item_relationships" end # verify enum value allowable_values = ["categories"] if @api_client.config.client_side_validation && !allowable_values.include?(related_resource) fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-items/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_item_relationships", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_item_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Item Variants # Get all variants related to the given item ID. Use filters to return specific fields. Request specific fields [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Variants can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 variants per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param item_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Hash] def get_catalog_item_variants(item_id, opts = {}) data, _status_code, _headers = get_catalog_item_variants_with_http_info(item_id, opts) data end # Get Catalog Item Variants # Get all variants related to the given item ID. Use filters to return specific fields. Request specific fields [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Variants can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 variants per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param item_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_item_variants_with_http_info(item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_item_variants ...' end # verify the required parameter 'item_id' is set if @api_client.config.client_side_validation && item_id.nil? fail ArgumentError, "Missing the required parameter 'item_id' when calling CatalogsApi.get_catalog_item_variants" end allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end allowable_values = ["created", "-created"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-items/{item_id}/variants/'.sub('{' + 'item_id' + '}', CGI.escape(item_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_item_variants", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_item_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Items # Get all catalog items in an account. Catalog items can be sorted by the following fields, in ascending and descending order: `created` Use filters to return specific fields and any variants. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `variants` Returns a maximum of 100 items per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category`: `equals`<br>`title`: `contains`<br>`published`: `equals` # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Hash] def get_catalog_items(opts = {}) data, _status_code, _headers = get_catalog_items_with_http_info(opts) data end # Get Catalog Items # Get all catalog items in an account. Catalog items can be sorted by the following fields, in ascending and descending order: `created` Use filters to return specific fields and any variants. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `variants` Returns a maximum of 100 items per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`category`: `equals`<br>`title`: `contains`<br>`published`: `equals` # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_items_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_items ...' end allowable_values = ["external_id", "title", "description", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" end allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end allowable_values = ["variants"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end allowable_values = ["created", "-created"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-items/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_items", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Variant # Get a catalog item variant with the given variant ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Hash] def get_catalog_variant(id, opts = {}) data, _status_code, _headers = get_catalog_variant_with_http_info(id, opts) data end # Get Catalog Variant # Get a catalog item variant with the given variant ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_variant_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_variant ...' 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 CatalogsApi.get_catalog_variant" end allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-variants/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_variant", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Catalog Variants # Get all variants in an account. Use filters to return specific fields. Request specific fields [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Variants can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 variants per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Hash] def get_catalog_variants(opts = {}) data, _status_code, _headers = get_catalog_variants_with_http_info(opts) data end # Get Catalog Variants # Get all variants in an account. Use filters to return specific fields. Request specific fields [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Variants can be sorted by the following fields, in ascending and descending order: `created` Returns a maximum of 100 variants per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`ids`: `any`<br>`item`: `equals`<br>`sku`: `equals`<br>`title`: `contains`<br>`published`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_catalog_variants_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_catalog_variants ...' end allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end allowable_values = ["created", "-created"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-variants/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_catalog_variants", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_catalog_variants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Create Categories Job # Get a catalog category bulk create job with the given job ID. Include parameters can be provided to get the following related resource data: `categories`

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Hash] def get_create_categories_job(job_id, opts = {}) data, _status_code, _headers = get_create_categories_job_with_http_info(job_id, opts) data end # Get Create Categories Job # Get a catalog category bulk create job with the given job ID. Include parameters can be provided to get the following related resource data: `categories`<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_create_categories_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_categories_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_create_categories_job" end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_create_job'] && !opts[:'fields_catalog_category_bulk_create_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_create_job\", must include one of #{allowable_values}" end allowable_values = ["external_id", "name", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" end allowable_values = ["categories"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-category-bulk-create-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-category-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_create_job'], :csv) if !opts[:'fields_catalog_category_bulk_create_job'].nil? query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_create_categories_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_create_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Create Categories Jobs # Get all catalog category bulk create jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_create_categories_jobs(opts = {}) data, _status_code, _headers = get_create_categories_jobs_with_http_info(opts) data end # Get Create Categories Jobs # Get all catalog category bulk create jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_create_categories_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_categories_jobs ...' end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_create_job'] && !opts[:'fields_catalog_category_bulk_create_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_create_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-category-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-category-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_create_job'], :csv) if !opts[:'fields_catalog_category_bulk_create_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_create_categories_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_create_categories_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Create Items Job # Get a catalog item bulk create job with the given job ID. Include parameters can be provided to get the following related resource data: `items`

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Hash] def get_create_items_job(job_id, opts = {}) data, _status_code, _headers = get_create_items_job_with_http_info(job_id, opts) data end # Get Create Items Job # Get a catalog item bulk create job with the given job ID. Include parameters can be provided to get the following related resource data: `items`<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_create_items_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_items_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_create_items_job" end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_create_job'] && !opts[:'fields_catalog_item_bulk_create_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_create_job\", must include one of #{allowable_values}" end allowable_values = ["external_id", "title", "description", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" end allowable_values = ["items"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-item-bulk-create-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-item-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_create_job'], :csv) if !opts[:'fields_catalog_item_bulk_create_job'].nil? query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_create_items_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_create_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Create Items Jobs # Get all catalog item bulk create jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_create_items_jobs(opts = {}) data, _status_code, _headers = get_create_items_jobs_with_http_info(opts) data end # Get Create Items Jobs # Get all catalog item bulk create jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_create_items_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_items_jobs ...' end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_create_job'] && !opts[:'fields_catalog_item_bulk_create_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_create_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-item-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-item-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_create_job'], :csv) if !opts[:'fields_catalog_item_bulk_create_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_create_items_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_create_items_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Create Variants Job # Get a catalog variant bulk create job with the given job ID. Include parameters can be provided to get the following related resource data: `variants`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Hash] def get_create_variants_job(job_id, opts = {}) data, _status_code, _headers = get_create_variants_job_with_http_info(job_id, opts) data end # Get Create Variants Job # Get a catalog variant bulk create job with the given job ID. Include parameters can be provided to get the following related resource data: `variants`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_create_variants_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_variants_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_create_variants_job" end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_create_job'] && !opts[:'fields_catalog_variant_bulk_create_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_create_job\", must include one of #{allowable_values}" end allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end allowable_values = ["variants"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-variant-bulk-create-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-variant-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_create_job'], :csv) if !opts[:'fields_catalog_variant_bulk_create_job'].nil? query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_create_variants_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_create_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Create Variants Jobs # Get all catalog variant bulk create jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_create_variants_jobs(opts = {}) data, _status_code, _headers = get_create_variants_jobs_with_http_info(opts) data end # Get Create Variants Jobs # Get all catalog variant bulk create jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_create_variants_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_create_variants_jobs ...' end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_create_job'] && !opts[:'fields_catalog_variant_bulk_create_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_create_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-variant-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-variant-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_create_job'], :csv) if !opts[:'fields_catalog_variant_bulk_create_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_create_variants_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_create_variants_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Delete Categories Job # Get a catalog category bulk delete job with the given job ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Hash] def get_delete_categories_job(job_id, opts = {}) data, _status_code, _headers = get_delete_categories_job_with_http_info(job_id, opts) data end # Get Delete Categories Job # Get a catalog category bulk delete job with the given job ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_delete_categories_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_categories_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_delete_categories_job" end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_delete_job'] && !opts[:'fields_catalog_category_bulk_delete_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_delete_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-category-bulk-delete-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-category-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_delete_job'], :csv) if !opts[:'fields_catalog_category_bulk_delete_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_delete_categories_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_delete_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Delete Categories Jobs # Get all catalog category bulk delete jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_delete_categories_jobs(opts = {}) data, _status_code, _headers = get_delete_categories_jobs_with_http_info(opts) data end # Get Delete Categories Jobs # Get all catalog category bulk delete jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_delete_categories_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_categories_jobs ...' end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_delete_job'] && !opts[:'fields_catalog_category_bulk_delete_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_delete_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-category-bulk-delete-jobs/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-category-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_delete_job'], :csv) if !opts[:'fields_catalog_category_bulk_delete_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_delete_categories_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_delete_categories_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Delete Items Job # Get a catalog item bulk delete job with the given job ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Hash] def get_delete_items_job(job_id, opts = {}) data, _status_code, _headers = get_delete_items_job_with_http_info(job_id, opts) data end # Get Delete Items Job # Get a catalog item bulk delete job with the given job ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_delete_items_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_items_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_delete_items_job" end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_delete_job'] && !opts[:'fields_catalog_item_bulk_delete_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_delete_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-item-bulk-delete-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-item-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_delete_job'], :csv) if !opts[:'fields_catalog_item_bulk_delete_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_delete_items_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_delete_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Delete Items Jobs # Get all catalog item bulk delete jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_delete_items_jobs(opts = {}) data, _status_code, _headers = get_delete_items_jobs_with_http_info(opts) data end # Get Delete Items Jobs # Get all catalog item bulk delete jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_delete_items_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_items_jobs ...' end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_delete_job'] && !opts[:'fields_catalog_item_bulk_delete_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_delete_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-item-bulk-delete-jobs/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-item-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_delete_job'], :csv) if !opts[:'fields_catalog_item_bulk_delete_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_delete_items_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_delete_items_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Delete Variants Job # Get a catalog variant bulk delete job with the given job ID.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Hash] def get_delete_variants_job(job_id, opts = {}) data, _status_code, _headers = get_delete_variants_job_with_http_info(job_id, opts) data end # Get Delete Variants Job # Get a catalog variant bulk delete job with the given job ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_delete_variants_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_variants_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_delete_variants_job" end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_delete_job'] && !opts[:'fields_catalog_variant_bulk_delete_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_delete_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-variant-bulk-delete-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-variant-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_delete_job'], :csv) if !opts[:'fields_catalog_variant_bulk_delete_job'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_delete_variants_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_delete_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Delete Variants Jobs # Get all catalog variant bulk delete jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_delete_variants_jobs(opts = {}) data, _status_code, _headers = get_delete_variants_jobs_with_http_info(opts) data end # Get Delete Variants Jobs # Get all catalog variant bulk delete jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_delete_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_delete_variants_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_delete_variants_jobs ...' end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_delete_job'] && !opts[:'fields_catalog_variant_bulk_delete_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_delete_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-variant-bulk-delete-jobs/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-variant-bulk-delete-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_delete_job'], :csv) if !opts[:'fields_catalog_variant_bulk_delete_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_delete_variants_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_delete_variants_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Update Categories Job # Get a catalog category bulk update job with the given job ID. Include parameters can be provided to get the following related resource data: `categories`

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Hash] def get_update_categories_job(job_id, opts = {}) data, _status_code, _headers = get_update_categories_job_with_http_info(job_id, opts) data end # Get Update Categories Job # Get a catalog category bulk update job with the given job ID. Include parameters can be provided to get the following related resource data: `categories`<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_category For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_update_categories_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_categories_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_update_categories_job" end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_update_job'] && !opts[:'fields_catalog_category_bulk_update_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_update_job\", must include one of #{allowable_values}" end allowable_values = ["external_id", "name", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category'] && !opts[:'fields_catalog_category'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category\", must include one of #{allowable_values}" end allowable_values = ["categories"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-category-bulk-update-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-category-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_update_job'], :csv) if !opts[:'fields_catalog_category_bulk_update_job'].nil? query_params[:'fields[catalog-category]'] = @api_client.build_collection_param(opts[:'fields_catalog_category'], :csv) if !opts[:'fields_catalog_category'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_update_categories_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_update_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Update Categories Jobs # Get all catalog category bulk update jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_update_categories_jobs(opts = {}) data, _status_code, _headers = get_update_categories_jobs_with_http_info(opts) data end # Get Update Categories Jobs # Get all catalog category bulk update jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_category_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_update_categories_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_categories_jobs ...' end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_category_bulk_update_job'] && !opts[:'fields_catalog_category_bulk_update_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_category_bulk_update_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-category-bulk-update-jobs/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-category-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_category_bulk_update_job'], :csv) if !opts[:'fields_catalog_category_bulk_update_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_update_categories_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_update_categories_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Update Items Job # Get a catalog item bulk update job with the given job ID. Include parameters can be provided to get the following related resource data: `items`

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Hash] def get_update_items_job(job_id, opts = {}) data, _status_code, _headers = get_update_items_job_with_http_info(job_id, opts) data end # Get Update Items Job # Get a catalog item bulk update job with the given job ID. Include parameters can be provided to get the following related resource data: `items`<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_item For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_update_items_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_items_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_update_items_job" end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_update_job'] && !opts[:'fields_catalog_item_bulk_update_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_update_job\", must include one of #{allowable_values}" end allowable_values = ["external_id", "title", "description", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item'] && !opts[:'fields_catalog_item'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item\", must include one of #{allowable_values}" end allowable_values = ["items"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-item-bulk-update-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-item-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_update_job'], :csv) if !opts[:'fields_catalog_item_bulk_update_job'].nil? query_params[:'fields[catalog-item]'] = @api_client.build_collection_param(opts[:'fields_catalog_item'], :csv) if !opts[:'fields_catalog_item'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_update_items_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_update_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Update Items Jobs # Get all catalog item bulk update jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_update_items_jobs(opts = {}) data, _status_code, _headers = get_update_items_jobs_with_http_info(opts) data end # Get Update Items Jobs # Get all catalog item bulk update jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_item_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_update_items_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_items_jobs ...' end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_item_bulk_update_job'] && !opts[:'fields_catalog_item_bulk_update_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_item_bulk_update_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-item-bulk-update-jobs/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-item-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_item_bulk_update_job'], :csv) if !opts[:'fields_catalog_item_bulk_update_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_update_items_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_update_items_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Update Variants Job # Get a catalog variate bulk update job with the given job ID. Include parameters can be provided to get the following related resource data: `variants`.

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Hash] def get_update_variants_job(job_id, opts = {}) data, _status_code, _headers = get_update_variants_job_with_http_info(job_id, opts) data end # Get Update Variants Job # Get a catalog variate bulk update job with the given job ID. Include parameters can be provided to get the following related resource data: `variants`.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param job_id [String] # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :fields_catalog_variant For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [Array] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_update_variants_job_with_http_info(job_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_variants_job ...' end # verify the required parameter 'job_id' is set if @api_client.config.client_side_validation && job_id.nil? fail ArgumentError, "Missing the required parameter 'job_id' when calling CatalogsApi.get_update_variants_job" end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_update_job'] && !opts[:'fields_catalog_variant_bulk_update_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_update_job\", must include one of #{allowable_values}" end allowable_values = ["external_id", "title", "description", "sku", "inventory_policy", "inventory_quantity", "price", "url", "image_full_url", "image_thumbnail_url", "images", "custom_metadata", "published", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant'] && !opts[:'fields_catalog_variant'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant\", must include one of #{allowable_values}" end allowable_values = ["variants"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-variant-bulk-update-jobs/{job_id}/'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-variant-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_update_job'], :csv) if !opts[:'fields_catalog_variant_bulk_update_job'].nil? query_params[:'fields[catalog-variant]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant'], :csv) if !opts[:'fields_catalog_variant'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_update_variants_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_update_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Update Variants Jobs # Get all catalog variant bulk update jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).

*Rate limits*:
Burst: `350/s`
Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Hash] def get_update_variants_jobs(opts = {}) data, _status_code, _headers = get_update_variants_jobs_with_http_info(opts) data end # Get Update Variants Jobs # Get all catalog variant bulk update jobs. Returns a maximum of 100 jobs per request, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Catalogs Read` # @param [Hash] opts the optional parameters # @option opts [Array] :fields_catalog_variant_bulk_update_job For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals` # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_update_variants_jobs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.get_update_variants_jobs ...' end allowable_values = ["job_id", "status", "created_at", "total_count", "completed_count", "failed_count", "completed_at", "expires_at", "errors"] if @api_client.config.client_side_validation && opts[:'fields_catalog_variant_bulk_update_job'] && !opts[:'fields_catalog_variant_bulk_update_job'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_catalog_variant_bulk_update_job\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/catalog-variant-bulk-update-jobs/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[catalog-variant-bulk-update-job]'] = @api_client.build_collection_param(opts[:'fields_catalog_variant_bulk_update_job'], :csv) if !opts[:'fields_catalog_variant_bulk_update_job'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.get_update_variants_jobs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#get_update_variants_jobs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Spawn Create Categories Job # Create a catalog category bulk create job to create a batch of catalog categories.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_category_create_job_create_query [CatalogCategoryCreateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def spawn_create_categories_job(catalog_category_create_job_create_query, opts = {}) data, _status_code, _headers = spawn_create_categories_job_with_http_info(catalog_category_create_job_create_query, opts) data end # Spawn Create Categories Job # Create a catalog category bulk create job to create a batch of catalog categories.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_category_create_job_create_query [CatalogCategoryCreateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def spawn_create_categories_job_with_http_info(catalog_category_create_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_create_categories_job ...' end # verify the required parameter 'catalog_category_create_job_create_query' is set if @api_client.config.client_side_validation && catalog_category_create_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_category_create_job_create_query' when calling CatalogsApi.spawn_create_categories_job" end # resource path local_var_path = '/api/catalog-category-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_create_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.spawn_create_categories_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#spawn_create_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Spawn Create Items Job # Create a catalog item bulk create job to create a batch of catalog items.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_item_create_job_create_query [CatalogItemCreateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def spawn_create_items_job(catalog_item_create_job_create_query, opts = {}) data, _status_code, _headers = spawn_create_items_job_with_http_info(catalog_item_create_job_create_query, opts) data end # Spawn Create Items Job # Create a catalog item bulk create job to create a batch of catalog items.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_item_create_job_create_query [CatalogItemCreateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def spawn_create_items_job_with_http_info(catalog_item_create_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_create_items_job ...' end # verify the required parameter 'catalog_item_create_job_create_query' is set if @api_client.config.client_side_validation && catalog_item_create_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_item_create_job_create_query' when calling CatalogsApi.spawn_create_items_job" end # resource path local_var_path = '/api/catalog-item-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_create_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.spawn_create_items_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#spawn_create_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Spawn Create Variants Job # Create a catalog variant bulk create job to create a batch of catalog variants.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_variant_create_job_create_query [CatalogVariantCreateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def spawn_create_variants_job(catalog_variant_create_job_create_query, opts = {}) data, _status_code, _headers = spawn_create_variants_job_with_http_info(catalog_variant_create_job_create_query, opts) data end # Spawn Create Variants Job # Create a catalog variant bulk create job to create a batch of catalog variants.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_variant_create_job_create_query [CatalogVariantCreateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def spawn_create_variants_job_with_http_info(catalog_variant_create_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_create_variants_job ...' end # verify the required parameter 'catalog_variant_create_job_create_query' is set if @api_client.config.client_side_validation && catalog_variant_create_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_variant_create_job_create_query' when calling CatalogsApi.spawn_create_variants_job" end # resource path local_var_path = '/api/catalog-variant-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_create_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.spawn_create_variants_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#spawn_create_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Spawn Delete Categories Job # Create a catalog category bulk delete job to delete a batch of catalog categories.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_category_delete_job_create_query [CatalogCategoryDeleteJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def spawn_delete_categories_job(catalog_category_delete_job_create_query, opts = {}) data, _status_code, _headers = spawn_delete_categories_job_with_http_info(catalog_category_delete_job_create_query, opts) data end # Spawn Delete Categories Job # Create a catalog category bulk delete job to delete a batch of catalog categories.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_category_delete_job_create_query [CatalogCategoryDeleteJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def spawn_delete_categories_job_with_http_info(catalog_category_delete_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_delete_categories_job ...' end # verify the required parameter 'catalog_category_delete_job_create_query' is set if @api_client.config.client_side_validation && catalog_category_delete_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_category_delete_job_create_query' when calling CatalogsApi.spawn_delete_categories_job" end # resource path local_var_path = '/api/catalog-category-bulk-delete-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_delete_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.spawn_delete_categories_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#spawn_delete_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Spawn Delete Items Job # Create a catalog item bulk delete job to delete a batch of catalog items.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_item_delete_job_create_query [CatalogItemDeleteJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def spawn_delete_items_job(catalog_item_delete_job_create_query, opts = {}) data, _status_code, _headers = spawn_delete_items_job_with_http_info(catalog_item_delete_job_create_query, opts) data end # Spawn Delete Items Job # Create a catalog item bulk delete job to delete a batch of catalog items.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_item_delete_job_create_query [CatalogItemDeleteJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def spawn_delete_items_job_with_http_info(catalog_item_delete_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_delete_items_job ...' end # verify the required parameter 'catalog_item_delete_job_create_query' is set if @api_client.config.client_side_validation && catalog_item_delete_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_item_delete_job_create_query' when calling CatalogsApi.spawn_delete_items_job" end # resource path local_var_path = '/api/catalog-item-bulk-delete-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_delete_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.spawn_delete_items_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#spawn_delete_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Spawn Delete Variants Job # Create a catalog variant bulk delete job to delete a batch of catalog variants.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_variant_delete_job_create_query [CatalogVariantDeleteJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def spawn_delete_variants_job(catalog_variant_delete_job_create_query, opts = {}) data, _status_code, _headers = spawn_delete_variants_job_with_http_info(catalog_variant_delete_job_create_query, opts) data end # Spawn Delete Variants Job # Create a catalog variant bulk delete job to delete a batch of catalog variants.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_variant_delete_job_create_query [CatalogVariantDeleteJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def spawn_delete_variants_job_with_http_info(catalog_variant_delete_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_delete_variants_job ...' end # verify the required parameter 'catalog_variant_delete_job_create_query' is set if @api_client.config.client_side_validation && catalog_variant_delete_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_variant_delete_job_create_query' when calling CatalogsApi.spawn_delete_variants_job" end # resource path local_var_path = '/api/catalog-variant-bulk-delete-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_delete_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.spawn_delete_variants_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#spawn_delete_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Spawn Update Categories Job # Create a catalog category bulk update job to update a batch of catalog categories.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_category_update_job_create_query [CatalogCategoryUpdateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def spawn_update_categories_job(catalog_category_update_job_create_query, opts = {}) data, _status_code, _headers = spawn_update_categories_job_with_http_info(catalog_category_update_job_create_query, opts) data end # Spawn Update Categories Job # Create a catalog category bulk update job to update a batch of catalog categories.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_category_update_job_create_query [CatalogCategoryUpdateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def spawn_update_categories_job_with_http_info(catalog_category_update_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_update_categories_job ...' end # verify the required parameter 'catalog_category_update_job_create_query' is set if @api_client.config.client_side_validation && catalog_category_update_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_category_update_job_create_query' when calling CatalogsApi.spawn_update_categories_job" end # resource path local_var_path = '/api/catalog-category-bulk-update-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_update_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.spawn_update_categories_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#spawn_update_categories_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Spawn Update Items Job # Create a catalog item bulk update job to update a batch of catalog items.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_item_update_job_create_query [CatalogItemUpdateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def spawn_update_items_job(catalog_item_update_job_create_query, opts = {}) data, _status_code, _headers = spawn_update_items_job_with_http_info(catalog_item_update_job_create_query, opts) data end # Spawn Update Items Job # Create a catalog item bulk update job to update a batch of catalog items.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_item_update_job_create_query [CatalogItemUpdateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def spawn_update_items_job_with_http_info(catalog_item_update_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_update_items_job ...' end # verify the required parameter 'catalog_item_update_job_create_query' is set if @api_client.config.client_side_validation && catalog_item_update_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_item_update_job_create_query' when calling CatalogsApi.spawn_update_items_job" end # resource path local_var_path = '/api/catalog-item-bulk-update-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_update_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.spawn_update_items_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#spawn_update_items_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Spawn Update Variants Job # Create a catalog variant bulk update job to update a batch of catalog variants.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_variant_update_job_create_query [CatalogVariantUpdateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def spawn_update_variants_job(catalog_variant_update_job_create_query, opts = {}) data, _status_code, _headers = spawn_update_variants_job_with_http_info(catalog_variant_update_job_create_query, opts) data end # Spawn Update Variants Job # Create a catalog variant bulk update job to update a batch of catalog variants.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param catalog_variant_update_job_create_query [CatalogVariantUpdateJobCreateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def spawn_update_variants_job_with_http_info(catalog_variant_update_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.spawn_update_variants_job ...' end # verify the required parameter 'catalog_variant_update_job_create_query' is set if @api_client.config.client_side_validation && catalog_variant_update_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_variant_update_job_create_query' when calling CatalogsApi.spawn_update_variants_job" end # resource path local_var_path = '/api/catalog-variant-bulk-update-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_update_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.spawn_update_variants_job", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#spawn_update_variants_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Catalog Category # Update a catalog category with the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param catalog_category_update_query [CatalogCategoryUpdateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def update_catalog_category(id, catalog_category_update_query, opts = {}) data, _status_code, _headers = update_catalog_category_with_http_info(id, catalog_category_update_query, opts) data end # Update Catalog Category # Update a catalog category with the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param catalog_category_update_query [CatalogCategoryUpdateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def update_catalog_category_with_http_info(id, catalog_category_update_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_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 CatalogsApi.update_catalog_category" end # verify the required parameter 'catalog_category_update_query' is set if @api_client.config.client_side_validation && catalog_category_update_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_category_update_query' when calling CatalogsApi.update_catalog_category" end # resource path local_var_path = '/api/catalog-categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_update_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.update_catalog_category", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Catalog Category Relationships # Update item relationships for the given category ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters # @return [nil] def update_catalog_category_relationships(id, related_resource, catalog_category_item_op, opts = {}) update_catalog_category_relationships_with_http_info(id, related_resource, catalog_category_item_op, opts) nil end # Update Catalog Category Relationships # Update item relationships for the given category ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_category_item_op [CatalogCategoryItemOp] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_catalog_category_relationships_with_http_info(id, related_resource, catalog_category_item_op, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_category_relationships ...' 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 CatalogsApi.update_catalog_category_relationships" end # verify the required parameter 'related_resource' is set if @api_client.config.client_side_validation && related_resource.nil? fail ArgumentError, "Missing the required parameter 'related_resource' when calling CatalogsApi.update_catalog_category_relationships" end # verify enum value allowable_values = ["items"] if @api_client.config.client_side_validation && !allowable_values.include?(related_resource) fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}" end # verify the required parameter 'catalog_category_item_op' is set if @api_client.config.client_side_validation && catalog_category_item_op.nil? fail ArgumentError, "Missing the required parameter 'catalog_category_item_op' when calling CatalogsApi.update_catalog_category_relationships" end # resource path local_var_path = '/api/catalog-categories/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_category_item_op) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.update_catalog_category_relationships", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_category_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Catalog Item # Update a catalog item with the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param catalog_item_update_query [CatalogItemUpdateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def update_catalog_item(id, catalog_item_update_query, opts = {}) data, _status_code, _headers = update_catalog_item_with_http_info(id, catalog_item_update_query, opts) data end # Update Catalog Item # Update a catalog item with the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param catalog_item_update_query [CatalogItemUpdateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def update_catalog_item_with_http_info(id, catalog_item_update_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_item ...' 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 CatalogsApi.update_catalog_item" end # verify the required parameter 'catalog_item_update_query' is set if @api_client.config.client_side_validation && catalog_item_update_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_item_update_query' when calling CatalogsApi.update_catalog_item" end # resource path local_var_path = '/api/catalog-items/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_update_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.update_catalog_item", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Catalog Item Relationships # Update catalog category relationships for the given item ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [nil] def update_catalog_item_relationships(id, related_resource, catalog_item_category_op, opts = {}) update_catalog_item_relationships_with_http_info(id, related_resource, catalog_item_category_op, opts) nil end # Update Catalog Item Relationships # Update catalog category relationships for the given item ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param related_resource [String] # @param catalog_item_category_op [CatalogItemCategoryOp] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_catalog_item_relationships_with_http_info(id, related_resource, catalog_item_category_op, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_item_relationships ...' 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 CatalogsApi.update_catalog_item_relationships" end # verify the required parameter 'related_resource' is set if @api_client.config.client_side_validation && related_resource.nil? fail ArgumentError, "Missing the required parameter 'related_resource' when calling CatalogsApi.update_catalog_item_relationships" end # verify enum value allowable_values = ["categories"] if @api_client.config.client_side_validation && !allowable_values.include?(related_resource) fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}" end # verify the required parameter 'catalog_item_category_op' is set if @api_client.config.client_side_validation && catalog_item_category_op.nil? fail ArgumentError, "Missing the required parameter 'catalog_item_category_op' when calling CatalogsApi.update_catalog_item_relationships" end # resource path local_var_path = '/api/catalog-items/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_item_category_op) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.update_catalog_item_relationships", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_item_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Catalog Variant # Update a catalog item variant with the given variant ID.

*Rate limits*:
Burst: `75/s`
Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param catalog_variant_update_query [CatalogVariantUpdateQuery] # @param [Hash] opts the optional parameters # @return [Hash] def update_catalog_variant(id, catalog_variant_update_query, opts = {}) data, _status_code, _headers = update_catalog_variant_with_http_info(id, catalog_variant_update_query, opts) data end # Update Catalog Variant # Update a catalog item variant with the given variant ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Catalogs Write` # @param id [String] # @param catalog_variant_update_query [CatalogVariantUpdateQuery] # @param [Hash] opts the optional parameters # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def update_catalog_variant_with_http_info(id, catalog_variant_update_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CatalogsApi.update_catalog_variant ...' 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 CatalogsApi.update_catalog_variant" end # verify the required parameter 'catalog_variant_update_query' is set if @api_client.config.client_side_validation && catalog_variant_update_query.nil? fail ArgumentError, "Missing the required parameter 'catalog_variant_update_query' when calling CatalogsApi.update_catalog_variant" end # resource path local_var_path = '/api/catalog-variants/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-10-17" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_variant_update_query) # return_type return_type = opts[:debug_return_type] || 'Hash' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] new_options = opts.merge( :operation => :"CatalogsApi.update_catalog_variant", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: CatalogsApi#update_catalog_variant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end