Class: MailSlurpClient::UserControllerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mailslurp_client/api/user_controller_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UserControllerApi

Returns a new instance of UserControllerApi.



19
20
21
# File 'lib/mailslurp_client/api/user_controller_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/mailslurp_client/api/user_controller_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_entity_automations(opts = {}) ⇒ PageEntityAutomationItems

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index (default to 0)

  • :size (Integer)

    Optional page size (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'DESC')

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :inbox_id (String)

    Optional inbox ID

  • :phone_id (String)

    Optional phone ID

  • :filter (String)

    Optional automation type filter

Returns:



32
33
34
35
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 32

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

#get_entity_automations_with_http_info(opts = {}) ⇒ Array<(PageEntityAutomationItems, Integer, Hash)>

Returns PageEntityAutomationItems data, response status code and response headers.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index

  • :size (Integer)

    Optional page size

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :inbox_id (String)

    Optional inbox ID

  • :phone_id (String)

    Optional phone ID

  • :filter (String)

    Optional automation type filter

Returns:

  • (Array<(PageEntityAutomationItems, Integer, Hash)>)

    PageEntityAutomationItems data, response status code and response headers



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
81
82
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
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 47

def get_entity_automations_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserControllerApi.get_entity_automations ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling UserControllerApi.get_entity_automations, must be smaller than or equal to 100.'
  end

  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["INBOX_FORWARDER", "INBOX_REPLIER", "INBOX_RULESET"]
  if @api_client.config.client_side_validation && opts[:'filter'] && !allowable_values.include?(opts[:'filter'])
    fail ArgumentError, "invalid value for \"filter\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/user/automations'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'phoneId'] = opts[:'phone_id'] if !opts[:'phone_id'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageEntityAutomationItems' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserControllerApi#get_entity_automations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_entity_events(opts = {}) ⇒ PageEntityEventItems

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index (default to 0)

  • :size (Integer)

    Optional page size (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'DESC')

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :inbox_id (String)

    Optional inbox ID

  • :email_id (String)

    Optional email ID

  • :phone_id (String)

    Optional phone ID

  • :sms_id (String)

    Optional SMS ID

  • :attachment_id (String)

    Optional attachment ID

  • :filter (String)

    Optional type filter

Returns:



123
124
125
126
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 123

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

#get_entity_events_with_http_info(opts = {}) ⇒ Array<(PageEntityEventItems, Integer, Hash)>

Returns PageEntityEventItems data, response status code and response headers.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index

  • :size (Integer)

    Optional page size

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :inbox_id (String)

    Optional inbox ID

  • :email_id (String)

    Optional email ID

  • :phone_id (String)

    Optional phone ID

  • :sms_id (String)

    Optional SMS ID

  • :attachment_id (String)

    Optional attachment ID

  • :filter (String)

    Optional type filter

Returns:

  • (Array<(PageEntityEventItems, Integer, Hash)>)

    PageEntityEventItems data, response status code and response headers



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
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
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 141

def get_entity_events_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserControllerApi.get_entity_events ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling UserControllerApi.get_entity_events, must be smaller than or equal to 100.'
  end

  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["WEBHOOK_EVENT", "INBOX_FORWARDER_EVENT", "INBOX_REPLIER_EVENT", "INBOX_RULESET_EVENT", "ALIAS_EVENT"]
  if @api_client.config.client_side_validation && opts[:'filter'] && !allowable_values.include?(opts[:'filter'])
    fail ArgumentError, "invalid value for \"filter\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/user/events'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'emailId'] = opts[:'email_id'] if !opts[:'email_id'].nil?
  query_params[:'phoneId'] = opts[:'phone_id'] if !opts[:'phone_id'].nil?
  query_params[:'smsId'] = opts[:'sms_id'] if !opts[:'sms_id'].nil?
  query_params[:'attachmentId'] = opts[:'attachment_id'] if !opts[:'attachment_id'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageEntityEventItems' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserControllerApi#get_entity_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_entity_favorites(opts = {}) ⇒ PageEntityFavouriteItems

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index (default to 0)

  • :size (Integer)

    Optional page size (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'DESC')

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :filter (String)

    Optional type filter

Returns:



215
216
217
218
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 215

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

#get_entity_favorites_with_http_info(opts = {}) ⇒ Array<(PageEntityFavouriteItems, Integer, Hash)>

Returns PageEntityFavouriteItems data, response status code and response headers.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index

  • :size (Integer)

    Optional page size

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :filter (String)

    Optional type filter

Returns:

  • (Array<(PageEntityFavouriteItems, Integer, Hash)>)

    PageEntityFavouriteItems data, response status code and response headers



228
229
230
231
232
233
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 228

def get_entity_favorites_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserControllerApi.get_entity_favorites ...'
  end
  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling UserControllerApi.get_entity_favorites, must be smaller than or equal to 100.'
  end

  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["INBOX", "EMAIL", "ATTACHMENT", "PHONE", "SMS"]
  if @api_client.config.client_side_validation && opts[:'filter'] && !allowable_values.include?(opts[:'filter'])
    fail ArgumentError, "invalid value for \"filter\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/user/favorites'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'PageEntityFavouriteItems' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserControllerApi#get_entity_favorites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_json_property_as_string(property, body, opts = {}) ⇒ String

Utility function to extract properties from JSON objects in language where this is cumbersome.

Parameters:

  • property (String)

    JSON property name or dot separated path selector such as &#x60;a.b.c&#x60;

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

    the optional parameters

Returns:

  • (String)


294
295
296
297
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 294

def get_json_property_as_string(property, body, opts = {})
  data, _status_code, _headers = get_json_property_as_string_with_http_info(property, body, opts)
  data
end

#get_json_property_as_string_with_http_info(property, body, opts = {}) ⇒ Array<(String, Integer, Hash)>

Utility function to extract properties from JSON objects in language where this is cumbersome.

Parameters:

  • property (String)

    JSON property name or dot separated path selector such as &#x60;a.b.c&#x60;

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

    the optional parameters

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
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
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 304

def get_json_property_as_string_with_http_info(property, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserControllerApi.get_json_property_as_string ...'
  end
  # verify the required parameter 'property' is set
  if @api_client.config.client_side_validation && property.nil?
    fail ArgumentError, "Missing the required parameter 'property' when calling UserControllerApi.get_json_property_as_string"
  end
  # resource path
  local_var_path = '/user/json/pluck'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'property'] = property

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'String' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserControllerApi#get_json_property_as_string\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_info(opts = {}) ⇒ UserInfoDto

Get account information for your user

Parameters:

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

    the optional parameters

Returns:



357
358
359
360
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 357

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

#get_user_info_with_http_info(opts = {}) ⇒ Array<(UserInfoDto, Integer, Hash)>

Get account information for your user

Parameters:

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

    the optional parameters

Returns:

  • (Array<(UserInfoDto, Integer, Hash)>)

    UserInfoDto data, response status code and response headers



365
366
367
368
369
370
371
372
373
374
375
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
# File 'lib/mailslurp_client/api/user_controller_api.rb', line 365

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserControllerApi.get_user_info ...'
  end
  # resource path
  local_var_path = '/user/info'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'UserInfoDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserControllerApi#get_user_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end