Class: SibApiV3Sdk::SendersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/sib-api-v3-sdk/api/senders_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SendersApi

Returns a new instance of SendersApi.



19
20
21
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_sender(opts = {}) ⇒ CreateSenderModel

Create a new sender

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



26
27
28
29
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 26

def create_sender(opts = {})
  data, _status_code, _headers = create_sender_with_http_info(opts)
  data
end

#create_sender_with_http_info(opts = {}) ⇒ Array<(CreateSenderModel, Fixnum, Hash)>

Create a new sender

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(CreateSenderModel, Fixnum, Hash)>)

    CreateSenderModel data, response status code and response headers



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 35

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 = {}) ⇒ nil

Delete a sender

Parameters:

  • sender_id

    Id of the sender

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


74
75
76
77
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 74

def delete_sender(sender_id, opts = {})
  delete_sender_with_http_info(sender_id, opts)
  nil
end

#delete_sender_with_http_info(sender_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a sender

Parameters:

  • sender_id

    Id of the sender

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 83

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 = {}) ⇒ GetIps

Get all the dedicated IPs for your account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



124
125
126
127
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 124

def get_ips(opts = {})
  data, _status_code, _headers = get_ips_with_http_info(opts)
  data
end

#get_ips_from_sender(sender_id, opts = {}) ⇒ GetIpsFromSender

Get all the dedicated IPs for a sender

Parameters:

  • sender_id

    Id of the sender

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



171
172
173
174
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 171

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 = {}) ⇒ Array<(GetIpsFromSender, Fixnum, Hash)>

Get all the dedicated IPs for a sender

Parameters:

  • sender_id

    Id of the sender

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetIpsFromSender, Fixnum, Hash)>)

    GetIpsFromSender data, response status code and response headers



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 180

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 = {}) ⇒ Array<(GetIps, Fixnum, Hash)>

Get all the dedicated IPs for your account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetIps, Fixnum, Hash)>)

    GetIps data, response status code and response headers



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 132

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 = {}) ⇒ GetSendersList

Get the list of all your senders

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ip (String)

    Filter your senders for a specific ip (available for dedicated IP usage only)

  • :domain (String)

    Filter your senders for a specific domain

Returns:



224
225
226
227
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 224

def get_senders(opts = {})
  data, _status_code, _headers = get_senders_with_http_info(opts)
  data
end

#get_senders_with_http_info(opts = {}) ⇒ Array<(GetSendersList, Fixnum, Hash)>

Get the list of all your senders

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ip (String)

    Filter your senders for a specific ip (available for dedicated IP usage only)

  • :domain (String)

    Filter your senders for a specific domain

Returns:

  • (Array<(GetSendersList, Fixnum, Hash)>)

    GetSendersList data, response status code and response headers



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 234

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

#update_sender(sender_id, opts = {}) ⇒ nil

Update a sender

Parameters:

  • sender_id

    Id of the sender

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


276
277
278
279
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 276

def update_sender(sender_id, opts = {})
  update_sender_with_http_info(sender_id, opts)
  nil
end

#update_sender_with_http_info(sender_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update a sender

Parameters:

  • sender_id

    Id of the sender

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/sib-api-v3-sdk/api/senders_api.rb', line 286

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