Class: SibApiV3Sdk::MasterAccountApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MasterAccountApi

Returns a new instance of MasterAccountApi.



19
20
21
# File 'lib/sib-api-v3-sdk/api/master_account_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/master_account_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#corporate_master_account_get(opts = {}) ⇒ MasterDetailsResponse

Get the details of requested master account This endpoint will provide the details of the master account.

Parameters:

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

    the optional parameters

Returns:



37
38
39
40
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 37

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

#corporate_master_account_get_with_http_info(opts = {}) ⇒ Array<(MasterDetailsResponse, Fixnum, Hash)>

Get the details of requested master account This endpoint will provide the details of the master account.

Parameters:

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

    the optional parameters

Returns:

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

    MasterDetailsResponse data, response status code and response headers



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 46

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MasterAccountApi.corporate_master_account_get ...'
  end
  # resource path
  local_var_path = '/corporate/masterAccount'

  # 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 => 'MasterDetailsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasterAccountApi#corporate_master_account_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#corporate_sub_account_get(offset, limit, opts = {}) ⇒ SubAccountsResponse

Get the list of all the sub-accounts of the master account. This endpoint will provide the list all the sub-accounts of the master account.

Parameters:

  • offset

    Index of the first sub-account in the page

  • limit

    Number of sub-accounts to be displayed on each page

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

    the optional parameters

Returns:



87
88
89
90
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 87

def (offset, limit, opts = {})
  data, _status_code, _headers = (offset, limit, opts)
  data
end

#corporate_sub_account_get_with_http_info(offset, limit, opts = {}) ⇒ Array<(SubAccountsResponse, Fixnum, Hash)>

Get the list of all the sub-accounts of the master account. This endpoint will provide the list all the sub-accounts of the master account.

Parameters:

  • offset

    Index of the first sub-account in the page

  • limit

    Number of sub-accounts to be displayed on each page

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

    the optional parameters

Returns:

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

    SubAccountsResponse data, response status code and response headers



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 98

def (offset, limit, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MasterAccountApi.corporate_sub_account_get ...'
  end
  # verify the required parameter 'offset' is set
  if @api_client.config.client_side_validation && offset.nil?
    fail ArgumentError, "Missing the required parameter 'offset' when calling MasterAccountApi.corporate_sub_account_get"
  end
  # verify the required parameter 'limit' is set
  if @api_client.config.client_side_validation && limit.nil?
    fail ArgumentError, "Missing the required parameter 'limit' when calling MasterAccountApi.corporate_sub_account_get"
  end
  # resource path
  local_var_path = '/corporate/subAccount'

  # query parameters
  query_params = {}
  query_params[:'offset'] = offset
  query_params[:'limit'] = limit

  # 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 => 'SubAccountsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasterAccountApi#corporate_sub_account_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#corporate_sub_account_id_delete(id, opts = {}) ⇒ nil

Delete a sub-account

Parameters:

  • id

    Id of the sub-account organization to be deleted

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

    the optional parameters

Returns:

  • (nil)


147
148
149
150
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 147

def (id, opts = {})
  (id, opts)
  nil
end

#corporate_sub_account_id_delete_with_http_info(id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a sub-account

Parameters:

  • id

    Id of the sub-account organization to be deleted

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 156

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MasterAccountApi.corporate_sub_account_id_delete ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasterAccountApi.corporate_sub_account_id_delete"
  end
  # resource path
  local_var_path = '/corporate/subAccount/{id}'.sub('{' + 'id' + '}', 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: MasterAccountApi#corporate_sub_account_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#corporate_sub_account_id_get(id, opts = {}) ⇒ SubAccountDetailsResponse

Get sub-account details This endpoint will provide the details for the specified sub-account company

Parameters:

  • id

    Id of the sub-account organization

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

    the optional parameters

Returns:



199
200
201
202
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 199

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

#corporate_sub_account_id_get_with_http_info(id, opts = {}) ⇒ Array<(SubAccountDetailsResponse, Fixnum, Hash)>

Get sub-account details This endpoint will provide the details for the specified sub-account company

Parameters:

  • id

    Id of the sub-account organization

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

    the optional parameters

Returns:

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

    SubAccountDetailsResponse data, response status code and response headers



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 209

def (id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MasterAccountApi.corporate_sub_account_id_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasterAccountApi.corporate_sub_account_id_get"
  end
  # resource path
  local_var_path = '/corporate/subAccount/{id}'.sub('{' + 'id' + '}', 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 => 'SubAccountDetailsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasterAccountApi#corporate_sub_account_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#corporate_sub_account_id_plan_put(id, update_plan_details, opts = {}) ⇒ nil

Update sub-account plan This endpoint will update the sub-account plan

Parameters:

  • id

    Id of the sub-account organization

  • update_plan_details

    Values to update a sub-account plan

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

    the optional parameters

Returns:

  • (nil)


254
255
256
257
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 254

def (id, update_plan_details, opts = {})
  (id, update_plan_details, opts)
  nil
end

#corporate_sub_account_id_plan_put_with_http_info(id, update_plan_details, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update sub-account plan This endpoint will update the sub-account plan

Parameters:

  • id

    Id of the sub-account organization

  • update_plan_details

    Values to update a sub-account plan

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 265

def (id, update_plan_details, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MasterAccountApi.corporate_sub_account_id_plan_put ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MasterAccountApi.corporate_sub_account_id_plan_put"
  end
  # verify the required parameter 'update_plan_details' is set
  if @api_client.config.client_side_validation && update_plan_details.nil?
    fail ArgumentError, "Missing the required parameter 'update_plan_details' when calling MasterAccountApi.corporate_sub_account_id_plan_put"
  end
  # resource path
  local_var_path = '/corporate/subAccount/{id}/plan'.sub('{' + 'id' + '}', 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(update_plan_details)
  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: MasterAccountApi#corporate_sub_account_id_plan_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#corporate_sub_account_post(sub_account_create, opts = {}) ⇒ CreateSubAccountResponse

Create a new sub-account under a master account. This endpoint will create a new sub-account under a master account

Parameters:

  • sub_account_create

    values to create new sub-account

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

    the optional parameters

Returns:



312
313
314
315
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 312

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

#corporate_sub_account_post_with_http_info(sub_account_create, opts = {}) ⇒ Array<(CreateSubAccountResponse, Fixnum, Hash)>

Create a new sub-account under a master account. This endpoint will create a new sub-account under a master account

Parameters:

  • sub_account_create

    values to create new sub-account

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

    the optional parameters

Returns:

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

    CreateSubAccountResponse data, response status code and response headers



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 322

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MasterAccountApi.corporate_sub_account_post ...'
  end
  # verify the required parameter 'sub_account_create' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'sub_account_create' when calling MasterAccountApi.corporate_sub_account_post"
  end
  # resource path
  local_var_path = '/corporate/subAccount'

  # 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()
  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 => 'CreateSubAccountResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasterAccountApi#corporate_sub_account_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#corporate_sub_account_sso_token_post(sso_token_request, opts = {}) ⇒ GetSsoToken

Generate SSO token to access Sendinblue This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token.

Parameters:

  • sso_token_request

    Values to generate SSO token for sub-account

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

    the optional parameters

Returns:



366
367
368
369
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 366

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

#corporate_sub_account_sso_token_post_with_http_info(sso_token_request, opts = {}) ⇒ Array<(GetSsoToken, Fixnum, Hash)>

Generate SSO token to access Sendinblue This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint app.sendinblue.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token.

Parameters:

  • sso_token_request

    Values to generate SSO token for sub-account

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

    the optional parameters

Returns:

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

    GetSsoToken data, response status code and response headers



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/sib-api-v3-sdk/api/master_account_api.rb', line 376

def (sso_token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MasterAccountApi.corporate_sub_account_sso_token_post ...'
  end
  # verify the required parameter 'sso_token_request' is set
  if @api_client.config.client_side_validation && sso_token_request.nil?
    fail ArgumentError, "Missing the required parameter 'sso_token_request' when calling MasterAccountApi.corporate_sub_account_sso_token_post"
  end
  # resource path
  local_var_path = '/corporate/subAccount/ssoToken'

  # 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(sso_token_request)
  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 => 'GetSsoToken')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MasterAccountApi#corporate_sub_account_sso_token_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#setUserAgent(user_agent) ⇒ Object

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



25
26
27
28
29
30
# File 'lib/sib-api-v3-sdk/api/master_account_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