lib/MailchimpTransactional/api/templates_api.rb in MailchimpTransactional-1.0.9 vs lib/MailchimpTransactional/api/templates_api.rb in MailchimpTransactional-1.0.11
- old
+ new
@@ -1,11 +1,11 @@
=begin
#Mailchimp Transactional API
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
-OpenAPI spec version: 1.0.9
+OpenAPI spec version: 1.0.11
Contact: apihelp@mandrill.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.12
=end
@@ -14,221 +14,90 @@
module MailchimpTransactional
class TemplatesApi
attr_accessor :api_client
- attr_accessor :api_key
-
- def initialize(api_key = '', api_client = ApiClient.default)
- @api_key = api_key
+ def initialize(api_client = ApiClient.default)
@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)
+ def add(body = {})
+ data = @api_client.call_api(:POST, '/templates/add', body)
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)
+ def delete(body = {})
+ data = @api_client.call_api(:POST, '/templates/delete', body)
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<InlineResponse20062>]
- def list(body = {}, opts = {})
- data = list_with_http_info(body, opts)
+ def info(body = {})
+ data = @api_client.call_api(:POST, '/templates/info', body)
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<InlineResponse20062>, Fixnum, Hash)>] Array<InlineResponse20062> 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)
+ def list(body = {})
+ data = @api_client.call_api(:POST, '/templates/list', body)
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)
+ def publish(body = {})
+ data = @api_client.call_api(:POST, '/templates/publish', body)
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<InlineResponse20046>]
- def time_series(body = {}, opts = {})
- data = time_series_with_http_info(body, opts)
+ def render(body = {})
+ data = @api_client.call_api(:POST, '/templates/render', body)
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<InlineResponse20046>, Fixnum, Hash)>] Array<InlineResponse20046> 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)
+ def time_series(body = {})
+ data = @api_client.call_api(:POST, '/templates/time-series', body)
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
+ def update(body = {})
+ data = @api_client.call_api(:POST, '/templates/update', body)
+ data
end
end
end