=begin #Mailchimp Transactional API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.8 Contact: apihelp@mandrill.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.12 =end require 'uri' module MailchimpTransactional class TemplatesApi attr_accessor :api_client attr_accessor :api_key def initialize(api_key = '', api_client = ApiClient.default) @api_key = api_key @api_client = api_client end # Add template # Add a new template. # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20057] def add(body = {}, opts = {}) data = add_with_http_info(body, opts) data end # Add template # Add a new template. # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20057, Fixnum, Hash)>] InlineResponse20057 data, response status code and response headers def add_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/templates/add' # http body (model) data = @api_client.call_api(:POST, local_var_path, :body => body) return data end # Delete template # Delete a template. # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20061] def delete(body = {}, opts = {}) data = delete_with_http_info(body, opts) data end # Delete template # Delete a template. # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20061, Fixnum, Hash)>] InlineResponse20061 data, response status code and response headers def delete_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/templates/delete' # http body (model) data = @api_client.call_api(:POST, local_var_path, :body => body) return data end # Get template info # Get the information for an existing template. # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20058] def info(body = {}, opts = {}) data = info_with_http_info(body, opts) data end # Get template info # Get the information for an existing template. # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20058, Fixnum, Hash)>] InlineResponse20058 data, response status code and response headers def info_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/templates/info' # http body (model) data = @api_client.call_api(:POST, local_var_path, :body => body) return data end # List templates # Return a list of all the templates available to this user. # @param body # @param [Hash] opts the optional parameters # @return [Array] def list(body = {}, opts = {}) data = list_with_http_info(body, opts) data end # List templates # Return a list of all the templates available to this user. # @param body # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def list_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/templates/list' # http body (model) data = @api_client.call_api(:POST, local_var_path, :body => body) return data end # Publish template content # Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft. # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20060] def publish(body = {}, opts = {}) data = publish_with_http_info(body, opts) data end # Publish template content # Publish the content for the template. Any new messages sent using this template will start using the content that was previously in draft. # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20060, Fixnum, Hash)>] InlineResponse20060 data, response status code and response headers def publish_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/templates/publish' # http body (model) data = @api_client.call_api(:POST, local_var_path, :body => body) return data end # Render html template # Inject content and optionally merge fields into a template, returning the HTML that results. # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20063] def render(body = {}, opts = {}) data = render_with_http_info(body, opts) data end # Render html template # Inject content and optionally merge fields into a template, returning the HTML that results. # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20063, Fixnum, Hash)>] InlineResponse20063 data, response status code and response headers def render_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/templates/render' # http body (model) data = @api_client.call_api(:POST, local_var_path, :body => body) return data end # Get template history # Return the recent history (hourly stats for the last 30 days) for a template. # @param body # @param [Hash] opts the optional parameters # @return [Array] def time_series(body = {}, opts = {}) data = time_series_with_http_info(body, opts) data end # Get template history # Return the recent history (hourly stats for the last 30 days) for a template. # @param body # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def time_series_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/templates/time-series' # http body (model) data = @api_client.call_api(:POST, local_var_path, :body => body) return data end # Update template # Update the code for an existing template. If null is provided for any fields, the values will remain unchanged. # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20059] def update(body = {}, opts = {}) data = update_with_http_info(body, opts) data end # Update template # Update the code for an existing template. If null is provided for any fields, the values will remain unchanged. # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20059, Fixnum, Hash)>] InlineResponse20059 data, response status code and response headers def update_with_http_info(body, opts = {}) # add api key to request body body[:key] = @api_key # resource path local_var_path = '/templates/update' # http body (model) data = @api_client.call_api(:POST, local_var_path, :body => body) return data end end end