=begin #SendinBlue API #SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | OpenAPI spec version: 3.0.0 Contact: contact@sendinblue.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.3.1 =end require "uri" module SibApiV3Sdk class ResellerApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Add Email and/or SMS credits to a specific child account # # @param child_id id of reseller's child # @param add_credits Values to post to add credit to a specific child account # @param [Hash] opts the optional parameters # @return [RemainingCreditModel] def add_credits(child_id, add_credits, opts = {}) data, _status_code, _headers = add_credits_with_http_info(child_id, add_credits, opts) return data end # Add Email and/or SMS credits to a specific child account # # @param child_id id of reseller's child # @param add_credits Values to post to add credit to a specific child account # @param [Hash] opts the optional parameters # @return [Array<(RemainingCreditModel, Fixnum, Hash)>] RemainingCreditModel data, response status code and response headers def add_credits_with_http_info(child_id, add_credits, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResellerApi.add_credits ..." end # verify the required parameter 'child_id' is set if @api_client.config.client_side_validation && child_id.nil? fail ArgumentError, "Missing the required parameter 'child_id' when calling ResellerApi.add_credits" end # verify the required parameter 'add_credits' is set if @api_client.config.client_side_validation && add_credits.nil? fail ArgumentError, "Missing the required parameter 'add_credits' when calling ResellerApi.add_credits" end # resource path local_var_path = "/reseller/children/{childId}/credits/add".sub('{' + 'childId' + '}', child_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(add_credits) auth_names = ['api-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RemainingCreditModel') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#add_credits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Associate a dedicated IP to the child # # @param child_id id of reseller's child # @param ip_id IP's id # @param [Hash] opts the optional parameters # @return [nil] def associate_ip_to_child(child_id, ip_id, opts = {}) associate_ip_to_child_with_http_info(child_id, ip_id, opts) return nil end # Associate a dedicated IP to the child # # @param child_id id of reseller's child # @param ip_id IP's id # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def associate_ip_to_child_with_http_info(child_id, ip_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResellerApi.associate_ip_to_child ..." end # verify the required parameter 'child_id' is set if @api_client.config.client_side_validation && child_id.nil? fail ArgumentError, "Missing the required parameter 'child_id' when calling ResellerApi.associate_ip_to_child" end # verify the required parameter 'ip_id' is set if @api_client.config.client_side_validation && ip_id.nil? fail ArgumentError, "Missing the required parameter 'ip_id' when calling ResellerApi.associate_ip_to_child" end # resource path local_var_path = "/reseller/children/{childId}/ips/associate".sub('{' + 'childId' + '}', child_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(ip_id) auth_names = ['api-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#associate_ip_to_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates a reseller child # # @param [Hash] opts the optional parameters # @option opts [CreateChild] :reseller_child reseller child to add # @return [CreateModel] def create_reseller_child(opts = {}) data, _status_code, _headers = create_reseller_child_with_http_info(opts) return data end # Creates a reseller child # # @param [Hash] opts the optional parameters # @option opts [CreateChild] :reseller_child reseller child to add # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers def create_reseller_child_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResellerApi.create_reseller_child ..." end # resource path local_var_path = "/reseller/children" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'reseller_child']) auth_names = ['api-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CreateModel') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#create_reseller_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes a single reseller child based on the childId supplied # # @param child_id id of reseller's child # @param [Hash] opts the optional parameters # @return [nil] def delete_reseller_child(child_id, opts = {}) delete_reseller_child_with_http_info(child_id, opts) return nil end # Deletes a single reseller child based on the childId supplied # # @param child_id id of reseller's child # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_reseller_child_with_http_info(child_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResellerApi.delete_reseller_child ..." end # verify the required parameter 'child_id' is set if @api_client.config.client_side_validation && child_id.nil? fail ArgumentError, "Missing the required parameter 'child_id' when calling ResellerApi.delete_reseller_child" end # resource path local_var_path = "/reseller/children/{childId}".sub('{' + 'childId' + '}', child_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#delete_reseller_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Dissociate a dedicated IP to the child # # @param child_id id of reseller's child # @param ip_id IP's id # @param [Hash] opts the optional parameters # @return [nil] def dissociate_ip_from_child(child_id, ip_id, opts = {}) dissociate_ip_from_child_with_http_info(child_id, ip_id, opts) return nil end # Dissociate a dedicated IP to the child # # @param child_id id of reseller's child # @param ip_id IP's id # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def dissociate_ip_from_child_with_http_info(child_id, ip_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResellerApi.dissociate_ip_from_child ..." end # verify the required parameter 'child_id' is set if @api_client.config.client_side_validation && child_id.nil? fail ArgumentError, "Missing the required parameter 'child_id' when calling ResellerApi.dissociate_ip_from_child" end # verify the required parameter 'ip_id' is set if @api_client.config.client_side_validation && ip_id.nil? fail ArgumentError, "Missing the required parameter 'ip_id' when calling ResellerApi.dissociate_ip_from_child" end # resource path local_var_path = "/reseller/children/{childId}/ips/dissociate".sub('{' + 'childId' + '}', child_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(ip_id) auth_names = ['api-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#dissociate_ip_from_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets the info about a specific child account # # @param child_id id of reseller's child # @param [Hash] opts the optional parameters # @return [GetChildInfo] def get_child_info(child_id, opts = {}) data, _status_code, _headers = get_child_info_with_http_info(child_id, opts) return data end # Gets the info about a specific child account # # @param child_id id of reseller's child # @param [Hash] opts the optional parameters # @return [Array<(GetChildInfo, Fixnum, Hash)>] GetChildInfo data, response status code and response headers def get_child_info_with_http_info(child_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResellerApi.get_child_info ..." end # verify the required parameter 'child_id' is set if @api_client.config.client_side_validation && child_id.nil? fail ArgumentError, "Missing the required parameter 'child_id' when calling ResellerApi.get_child_info" end # resource path local_var_path = "/reseller/children/{childId}".sub('{' + 'childId' + '}', child_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetChildInfo') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#get_child_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets the list of all reseller's children accounts # # @param [Hash] opts the optional parameters # @return [GetChildrenList] def get_reseller_childs(opts = {}) data, _status_code, _headers = get_reseller_childs_with_http_info(opts) return data end # Gets the list of all reseller's children accounts # # @param [Hash] opts the optional parameters # @return [Array<(GetChildrenList, Fixnum, Hash)>] GetChildrenList data, response status code and response headers def get_reseller_childs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResellerApi.get_reseller_childs ..." end # resource path local_var_path = "/reseller/children" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'GetChildrenList') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#get_reseller_childs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Remove Email and/or SMS credits from a specific child account # # @param child_id id of reseller's child # @param remove_credits Values to post to remove email or SMS credits from a specific child account # @param [Hash] opts the optional parameters # @return [RemainingCreditModel] def remove_credits(child_id, remove_credits, opts = {}) data, _status_code, _headers = remove_credits_with_http_info(child_id, remove_credits, opts) return data end # Remove Email and/or SMS credits from a specific child account # # @param child_id id of reseller's child # @param remove_credits Values to post to remove email or SMS credits from a specific child account # @param [Hash] opts the optional parameters # @return [Array<(RemainingCreditModel, Fixnum, Hash)>] RemainingCreditModel data, response status code and response headers def remove_credits_with_http_info(child_id, remove_credits, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResellerApi.remove_credits ..." end # verify the required parameter 'child_id' is set if @api_client.config.client_side_validation && child_id.nil? fail ArgumentError, "Missing the required parameter 'child_id' when calling ResellerApi.remove_credits" end # verify the required parameter 'remove_credits' is set if @api_client.config.client_side_validation && remove_credits.nil? fail ArgumentError, "Missing the required parameter 'remove_credits' when calling ResellerApi.remove_credits" end # resource path local_var_path = "/reseller/children/{childId}/credits/remove".sub('{' + 'childId' + '}', child_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(remove_credits) auth_names = ['api-key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RemainingCreditModel') if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#remove_credits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates infos of reseller's child based on the childId supplied # # @param child_id id of reseller's child # @param reseller_child values to update in child profile # @param [Hash] opts the optional parameters # @return [nil] def update_reseller_child(child_id, reseller_child, opts = {}) update_reseller_child_with_http_info(child_id, reseller_child, opts) return nil end # Updates infos of reseller's child based on the childId supplied # # @param child_id id of reseller's child # @param reseller_child values to update in child profile # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_reseller_child_with_http_info(child_id, reseller_child, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ResellerApi.update_reseller_child ..." end # verify the required parameter 'child_id' is set if @api_client.config.client_side_validation && child_id.nil? fail ArgumentError, "Missing the required parameter 'child_id' when calling ResellerApi.update_reseller_child" end # verify the required parameter 'reseller_child' is set if @api_client.config.client_side_validation && reseller_child.nil? fail ArgumentError, "Missing the required parameter 'reseller_child' when calling ResellerApi.update_reseller_child" end # resource path local_var_path = "/reseller/children/{childId}".sub('{' + 'childId' + '}', child_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(reseller_child) auth_names = ['api-key'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#update_reseller_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end