Class: MailSlurpClient::ExpiredControllerApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ExpiredControllerApi

Returns a new instance of ExpiredControllerApi.



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

def api_client
  @api_client
end

Instance Method Details

#get_expiration_defaults(opts = {}) ⇒ ExpirationDefaults

Get default expiration settings Return default times used for inbox expiration

Parameters:

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

    the optional parameters

Returns:



26
27
28
29
# File 'lib/mailslurp_client/api/expired_controller_api.rb', line 26

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

#get_expiration_defaults_with_http_info(opts = {}) ⇒ Array<(ExpirationDefaults, Integer, Hash)>

Get default expiration settings Return default times used for inbox expiration

Parameters:

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

    the optional parameters

Returns:

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

    ExpirationDefaults 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
70
71
72
73
74
75
76
# File 'lib/mailslurp_client/api/expired_controller_api.rb', line 35

def get_expiration_defaults_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExpiredControllerApi.get_expiration_defaults ...'
  end
  # resource path
  local_var_path = '/expired/defaults'

  # 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] || 'ExpirationDefaults' 

  # 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: ExpiredControllerApi#get_expiration_defaults\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_expired_inbox_by_inbox_id(inbox_id, opts = {}) ⇒ ExpiredInboxDto

Get expired inbox record for a previously existing inbox Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId

Parameters:

  • inbox_id (String)

    ID of inbox you want to retrieve (not the inbox ID)

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

    the optional parameters

Returns:



83
84
85
86
# File 'lib/mailslurp_client/api/expired_controller_api.rb', line 83

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

#get_expired_inbox_by_inbox_id_with_http_info(inbox_id, opts = {}) ⇒ Array<(ExpiredInboxDto, Integer, Hash)>

Get expired inbox record for a previously existing inbox Use the inboxId to return an ExpiredInboxRecord if an inbox has expired. Inboxes expire and are disabled if an expiration date is set or plan requires. Returns 404 if no expired inbox is found for the inboxId

Parameters:

  • inbox_id (String)

    ID of inbox you want to retrieve (not the inbox ID)

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

    the optional parameters

Returns:

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

    ExpiredInboxDto data, response status code and response headers



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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/mailslurp_client/api/expired_controller_api.rb', line 93

def get_expired_inbox_by_inbox_id_with_http_info(inbox_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExpiredControllerApi.get_expired_inbox_by_inbox_id ...'
  end
  # verify the required parameter 'inbox_id' is set
  if @api_client.config.client_side_validation && inbox_id.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_id' when calling ExpiredControllerApi.get_expired_inbox_by_inbox_id"
  end
  # resource path
  local_var_path = '/expired/inbox/{inboxId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))

  # 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] || 'ExpiredInboxDto' 

  # 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: ExpiredControllerApi#get_expired_inbox_by_inbox_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_expired_inbox_record(expired_id, opts = {}) ⇒ ExpiredInboxDto

Get an expired inbox record Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties

Parameters:

  • expired_id (String)

    ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId

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

    the optional parameters

Returns:



145
146
147
148
# File 'lib/mailslurp_client/api/expired_controller_api.rb', line 145

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

#get_expired_inbox_record_with_http_info(expired_id, opts = {}) ⇒ Array<(ExpiredInboxDto, Integer, Hash)>

Get an expired inbox record Inboxes created with an expiration date will expire after the given date and be moved to an ExpiredInbox entity. You can still read emails in the inbox but it can no longer send or receive emails. Fetch the expired inboxes to view the old inboxes properties

Parameters:

  • expired_id (String)

    ID of the ExpiredInboxRecord you want to retrieve. This is different from the ID of the inbox you are interested in. See other methods for getting ExpiredInboxRecord for an inbox inboxId

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

    the optional parameters

Returns:

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

    ExpiredInboxDto data, response status code and response headers



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
# File 'lib/mailslurp_client/api/expired_controller_api.rb', line 155

def get_expired_inbox_record_with_http_info(expired_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExpiredControllerApi.get_expired_inbox_record ...'
  end
  # verify the required parameter 'expired_id' is set
  if @api_client.config.client_side_validation && expired_id.nil?
    fail ArgumentError, "Missing the required parameter 'expired_id' when calling ExpiredControllerApi.get_expired_inbox_record"
  end
  # resource path
  local_var_path = '/expired/{expiredId}'.sub('{' + 'expiredId' + '}', CGI.escape(expired_id.to_s))

  # 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] || 'ExpiredInboxDto' 

  # 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: ExpiredControllerApi#get_expired_inbox_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_expired_inboxes(opts = {}) ⇒ PageExpiredInboxRecordProjection

List records of expired inboxes Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in inbox sent email list pagination (default to 0)

  • :size (Integer)

    Optional page size in inbox sent email list pagination (default to 20)

  • :sort (String)

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

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:



211
212
213
214
# File 'lib/mailslurp_client/api/expired_controller_api.rb', line 211

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

#get_expired_inboxes_with_http_info(opts = {}) ⇒ Array<(PageExpiredInboxRecordProjection, Integer, Hash)>

List records of expired inboxes Inboxes created with an expiration date will expire after the given date. An ExpiredInboxRecord is created that records the inboxes old ID and email address. You can still read emails in the inbox (using the inboxes old ID) but the email address associated with the inbox can no longer send or receive emails. Fetch expired inbox records to view the old inboxes properties

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in inbox sent email list pagination

  • :size (Integer)

    Optional page size in inbox sent email list pagination

  • :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

Returns:



225
226
227
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
# File 'lib/mailslurp_client/api/expired_controller_api.rb', line 225

def get_expired_inboxes_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExpiredControllerApi.get_expired_inboxes ...'
  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
  # resource path
  local_var_path = '/expired'

  # 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?

  # 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] || 'PageExpiredInboxRecordProjection' 

  # 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: ExpiredControllerApi#get_expired_inboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end