=begin #Mailchimp Transactional API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.6 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 WebhooksApi 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 # /webhooks/add # Add a new webhook # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20072] def add(body = {}, opts = {}) data, _status_code, _headers = add_with_http_info(body, opts) data end # /webhooks/add # Add a new webhook # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20072, Fixnum, Hash)>] InlineResponse20072 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 = '/webhooks/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 => 'InlineResponse20072') return data, status_code, headers end # /webhooks/delete # Delete an existing webhook # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20075] def delete(body = {}, opts = {}) data, _status_code, _headers = delete_with_http_info(body, opts) data end # /webhooks/delete # Delete an existing webhook # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20075, Fixnum, Hash)>] InlineResponse20075 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 = '/webhooks/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 => 'InlineResponse20075') return data, status_code, headers end # /webhooks/info # Given the ID of an existing webhook, return the data about it # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20073] def info(body = {}, opts = {}) data, _status_code, _headers = info_with_http_info(body, opts) data end # /webhooks/info # Given the ID of an existing webhook, return the data about it # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20073, Fixnum, Hash)>] InlineResponse20073 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 = '/webhooks/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 => 'InlineResponse20073') return data, status_code, headers end # /webhooks/list # Get the list of all webhooks defined on the account # @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 # /webhooks/list # Get the list of all webhooks defined on the account # @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 = '/webhooks/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 # /webhooks/update # Update an existing webhook # @param body # @param [Hash] opts the optional parameters # @return [InlineResponse20074] def update(body = {}, opts = {}) data, _status_code, _headers = update_with_http_info(body, opts) data end # /webhooks/update # Update an existing webhook # @param body # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20074, Fixnum, Hash)>] InlineResponse20074 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 = '/webhooks/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 => 'InlineResponse20074') return data, status_code, headers end end end