class SibApiV3Sdk::SendersApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/sib-api-v3-sdk/api/senders_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_sender(opts = {}) click to toggle source

Create a new sender @param [Hash] opts the optional parameters @option opts [CreateSender] :sender sender's name @return [CreateSenderModel]

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 36
def create_sender(opts = {})
  data, _status_code, _headers = create_sender_with_http_info(opts)
  data
end
create_sender_with_http_info(opts = {}) click to toggle source

Create a new sender @param [Hash] opts the optional parameters @option opts [CreateSender] :sender sender&#39;s name @return [Array<(CreateSenderModel, Fixnum, Hash)>] CreateSenderModel data, response status code and response headers

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 45
def create_sender_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SendersApi.create_sender ...'
  end
  # resource path
  local_var_path = '/senders'

  # 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[:'sender'])
  auth_names = ['api-key', 'partner-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 => 'CreateSenderModel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SendersApi#create_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_sender(sender_id, opts = {}) click to toggle source

Delete a sender @param sender_id Id of the sender @param [Hash] opts the optional parameters @return [nil]

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 84
def delete_sender(sender_id, opts = {})
  delete_sender_with_http_info(sender_id, opts)
  nil
end
delete_sender_with_http_info(sender_id, opts = {}) click to toggle source

Delete a sender @param sender_id Id of the sender @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 93
def delete_sender_with_http_info(sender_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SendersApi.delete_sender ...'
  end
  # verify the required parameter 'sender_id' is set
  if @api_client.config.client_side_validation && sender_id.nil?
    fail ArgumentError, "Missing the required parameter 'sender_id' when calling SendersApi.delete_sender"
  end
  # resource path
  local_var_path = '/senders/{senderId}'.sub('{' + 'senderId' + '}', sender_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', 'partner-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: SendersApi#delete_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_ips(opts = {}) click to toggle source

Get all the dedicated IPs for your account @param [Hash] opts the optional parameters @return [GetIps]

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 134
def get_ips(opts = {})
  data, _status_code, _headers = get_ips_with_http_info(opts)
  data
end
get_ips_from_sender(sender_id, opts = {}) click to toggle source

Get all the dedicated IPs for a sender @param sender_id Id of the sender @param [Hash] opts the optional parameters @return [GetIpsFromSender]

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 181
def get_ips_from_sender(sender_id, opts = {})
  data, _status_code, _headers = get_ips_from_sender_with_http_info(sender_id, opts)
  data
end
get_ips_from_sender_with_http_info(sender_id, opts = {}) click to toggle source

Get all the dedicated IPs for a sender @param sender_id Id of the sender @param [Hash] opts the optional parameters @return [Array<(GetIpsFromSender, Fixnum, Hash)>] GetIpsFromSender data, response status code and response headers

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 190
def get_ips_from_sender_with_http_info(sender_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SendersApi.get_ips_from_sender ...'
  end
  # verify the required parameter 'sender_id' is set
  if @api_client.config.client_side_validation && sender_id.nil?
    fail ArgumentError, "Missing the required parameter 'sender_id' when calling SendersApi.get_ips_from_sender"
  end
  # resource path
  local_var_path = '/senders/{senderId}/ips'.sub('{' + 'senderId' + '}', sender_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', 'partner-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 => 'GetIpsFromSender')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SendersApi#get_ips_from_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_ips_with_http_info(opts = {}) click to toggle source

Get all the dedicated IPs for your account @param [Hash] opts the optional parameters @return [Array<(GetIps, Fixnum, Hash)>] GetIps data, response status code and response headers

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 142
def get_ips_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SendersApi.get_ips ...'
  end
  # resource path
  local_var_path = '/senders/ips'

  # 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', 'partner-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 => 'GetIps')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SendersApi#get_ips\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_senders(opts = {}) click to toggle source

Get the list of all your senders @param [Hash] opts the optional parameters @option opts [String] :ip Filter your senders for a specific ip (available for dedicated IP usage only) @option opts [String] :domain Filter your senders for a specific domain @return [GetSendersList]

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 234
def get_senders(opts = {})
  data, _status_code, _headers = get_senders_with_http_info(opts)
  data
end
get_senders_with_http_info(opts = {}) click to toggle source

Get the list of all your senders @param [Hash] opts the optional parameters @option opts [String] :ip Filter your senders for a specific ip (available for dedicated IP usage only) @option opts [String] :domain Filter your senders for a specific domain @return [Array<(GetSendersList, Fixnum, Hash)>] GetSendersList data, response status code and response headers

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 244
def get_senders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SendersApi.get_senders ...'
  end
  # resource path
  local_var_path = '/senders'

  # query parameters
  query_params = {}
  query_params[:'ip'] = opts[:'ip'] if !opts[:'ip'].nil?
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?

  # 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', 'partner-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 => 'GetSendersList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SendersApi#get_senders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
setUserAgent(user_agent) click to toggle source

Set custom user_agent if explicitly passed in api default will still remain Swagger-Codegen/#{VERSION}/ruby

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 25
def setUserAgent(user_agent)
  @user_agent = user_agent
  if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_')
    @api_client.default_headers['User-Agent'] = @user_agent
  end
end
update_sender(sender_id, opts = {}) click to toggle source

Update a sender @param sender_id Id of the sender @param [Hash] opts the optional parameters @option opts [UpdateSender] :sender sender&#39;s name @return [nil]

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 286
def update_sender(sender_id, opts = {})
  update_sender_with_http_info(sender_id, opts)
  nil
end
update_sender_with_http_info(sender_id, opts = {}) click to toggle source

Update a sender @param sender_id Id of the sender @param [Hash] opts the optional parameters @option opts [UpdateSender] :sender sender&#39;s name @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/sib-api-v3-sdk/api/senders_api.rb, line 296
def update_sender_with_http_info(sender_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SendersApi.update_sender ...'
  end
  # verify the required parameter 'sender_id' is set
  if @api_client.config.client_side_validation && sender_id.nil?
    fail ArgumentError, "Missing the required parameter 'sender_id' when calling SendersApi.update_sender"
  end
  # resource path
  local_var_path = '/senders/{senderId}'.sub('{' + 'senderId' + '}', sender_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(opts[:'sender'])
  auth_names = ['api-key', 'partner-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: SendersApi#update_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end