=begin #Mailchimp Transactional API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.4 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 # /templates/add # Add a new template # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20057] def add(body = {}, opts = {}) data, _status_code, _headers = add_with_http_info(body, opts) data end # /templates/add # 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) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'InlineResponse20057') return data, status_code, headers end # /templates/delete # Delete a template # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20061] def delete(body = {}, opts = {}) data, _status_code, _headers = delete_with_http_info(body, opts) data end # /templates/delete # 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) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'InlineResponse20061') return data, status_code, headers end # /templates/info # Get the information for an existing template # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20058] def info(body = {}, opts = {}) data, _status_code, _headers = info_with_http_info(body, opts) data end # /templates/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) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'InlineResponse20058') return data, status_code, headers end # /templates/list # 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, _status_code, _headers = list_with_http_info(body, opts) data end # /templates/list # 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) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'Array') return data, status_code, headers end # /templates/publish # 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, _status_code, _headers = publish_with_http_info(body, opts) data end # /templates/publish # 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) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'InlineResponse20060') return data, status_code, headers end # /templates/render # 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, _status_code, _headers = render_with_http_info(body, opts) data end # /templates/render # 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) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'InlineResponse20063') return data, status_code, headers end # /templates/time-series # 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, _status_code, _headers = time_series_with_http_info(body, opts) data end # /templates/time-series # 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) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'Array') return data, status_code, headers end # /templates/update # 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, _status_code, _headers = update_with_http_info(body, opts) data end # /templates/update # 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) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :body => body, :auth_names => auth_names, :return_type => 'InlineResponse20059') return data, status_code, headers end end end