Class: Checkbook::Mailbox
- Inherits:
-
Object
- Object
- Checkbook::Mailbox
- Defined in:
- lib/checkbook/api/mailbox.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_mailbox(opts = {}) ⇒ CreateMailboxResponse
Create a mailbox Create a new mailbox.
-
#create_mailbox_with_http_info(opts = {}) ⇒ Array<(CreateMailboxResponse, Integer, Hash)>
Create a mailbox Create a new mailbox.
-
#get_mailbox(mailbox_id, opts = {}) ⇒ CreateMailboxResponse
Get mailbox info Get mailbox details.
-
#get_mailbox_item(mailbox_id, item_id, opts = {}) ⇒ MailResponse
Get mailbox item Get mailbox item.
-
#get_mailbox_item_attachment(mailbox_id, item_id, opts = {}) ⇒ Error
Get attachment for a mail piece Get mailbox item.
-
#get_mailbox_item_attachment_with_http_info(mailbox_id, item_id, opts = {}) ⇒ Array<(Error, Integer, Hash)>
Get attachment for a mail piece Get mailbox item.
-
#get_mailbox_item_with_http_info(mailbox_id, item_id, opts = {}) ⇒ Array<(MailResponse, Integer, Hash)>
Get mailbox item Get mailbox item.
-
#get_mailbox_with_http_info(mailbox_id, opts = {}) ⇒ Array<(CreateMailboxResponse, Integer, Hash)>
Get mailbox info Get mailbox details.
-
#initialize(api_client = ApiClient.default) ⇒ Mailbox
constructor
A new instance of Mailbox.
-
#query_mailbox(opts = {}) ⇒ GetMailboxesResponse
Get mailboxes Return the mailboxes for the current user.
-
#query_mailbox_item(mailbox_id, opts = {}) ⇒ GetMailResponse
Get mailbox info Get mailbox items.
-
#query_mailbox_item_with_http_info(mailbox_id, opts = {}) ⇒ Array<(GetMailResponse, Integer, Hash)>
Get mailbox info Get mailbox items.
-
#query_mailbox_with_http_info(opts = {}) ⇒ Array<(GetMailboxesResponse, Integer, Hash)>
Get mailboxes Return the mailboxes for the current user.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/checkbook/api/mailbox.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_mailbox(opts = {}) ⇒ CreateMailboxResponse
Create a mailbox Create a new mailbox
26 27 28 29 |
# File 'lib/checkbook/api/mailbox.rb', line 26 def create_mailbox(opts = {}) data, _status_code, _headers = create_mailbox_with_http_info(opts) data end |
#create_mailbox_with_http_info(opts = {}) ⇒ Array<(CreateMailboxResponse, Integer, Hash)>
Create a mailbox Create a new mailbox
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 77 |
# File 'lib/checkbook/api/mailbox.rb', line 35 def create_mailbox_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Mailbox.create_mailbox ...' end # resource path local_var_path = '/v3/mailbox' # 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(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateMailboxResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"Mailbox.create_mailbox", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: Mailbox#create_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_mailbox(mailbox_id, opts = {}) ⇒ CreateMailboxResponse
Get mailbox info Get mailbox details
84 85 86 87 |
# File 'lib/checkbook/api/mailbox.rb', line 84 def get_mailbox(mailbox_id, opts = {}) data, _status_code, _headers = get_mailbox_with_http_info(mailbox_id, opts) data end |
#get_mailbox_item(mailbox_id, item_id, opts = {}) ⇒ MailResponse
Get mailbox item Get mailbox item
148 149 150 151 |
# File 'lib/checkbook/api/mailbox.rb', line 148 def get_mailbox_item(mailbox_id, item_id, opts = {}) data, _status_code, _headers = get_mailbox_item_with_http_info(mailbox_id, item_id, opts) data end |
#get_mailbox_item_attachment(mailbox_id, item_id, opts = {}) ⇒ Error
Get attachment for a mail piece Get mailbox item
217 218 219 220 |
# File 'lib/checkbook/api/mailbox.rb', line 217 def (mailbox_id, item_id, opts = {}) data, _status_code, _headers = (mailbox_id, item_id, opts) data end |
#get_mailbox_item_attachment_with_http_info(mailbox_id, item_id, opts = {}) ⇒ Array<(Error, Integer, Hash)>
Get attachment for a mail piece Get mailbox item
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 |
# File 'lib/checkbook/api/mailbox.rb', line 228 def (mailbox_id, item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Mailbox.get_mailbox_item_attachment ...' end # verify the required parameter 'mailbox_id' is set if @api_client.config.client_side_validation && mailbox_id.nil? fail ArgumentError, "Missing the required parameter 'mailbox_id' when calling Mailbox.get_mailbox_item_attachment" end # verify the required parameter 'item_id' is set if @api_client.config.client_side_validation && item_id.nil? fail ArgumentError, "Missing the required parameter 'item_id' when calling Mailbox.get_mailbox_item_attachment" end # resource path local_var_path = '/v3/mailbox/{mailbox_id}/mail/{item_id}/attachment'.sub('{' + 'mailbox_id' + '}', CGI.escape(mailbox_id.to_s)).sub('{' + 'item_id' + '}', CGI.escape(item_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(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Error' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"Mailbox.get_mailbox_item_attachment", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: Mailbox#get_mailbox_item_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_mailbox_item_with_http_info(mailbox_id, item_id, opts = {}) ⇒ Array<(MailResponse, Integer, Hash)>
Get mailbox item Get mailbox item
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 206 207 208 209 |
# File 'lib/checkbook/api/mailbox.rb', line 159 def get_mailbox_item_with_http_info(mailbox_id, item_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Mailbox.get_mailbox_item ...' end # verify the required parameter 'mailbox_id' is set if @api_client.config.client_side_validation && mailbox_id.nil? fail ArgumentError, "Missing the required parameter 'mailbox_id' when calling Mailbox.get_mailbox_item" end # verify the required parameter 'item_id' is set if @api_client.config.client_side_validation && item_id.nil? fail ArgumentError, "Missing the required parameter 'item_id' when calling Mailbox.get_mailbox_item" end # resource path local_var_path = '/v3/mailbox/{mailbox_id}/mail/{item_id}'.sub('{' + 'mailbox_id' + '}', CGI.escape(mailbox_id.to_s)).sub('{' + 'item_id' + '}', CGI.escape(item_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(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'MailResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"Mailbox.get_mailbox_item", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: Mailbox#get_mailbox_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_mailbox_with_http_info(mailbox_id, opts = {}) ⇒ Array<(CreateMailboxResponse, Integer, Hash)>
Get mailbox info Get mailbox details
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 139 140 |
# File 'lib/checkbook/api/mailbox.rb', line 94 def get_mailbox_with_http_info(mailbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Mailbox.get_mailbox ...' end # verify the required parameter 'mailbox_id' is set if @api_client.config.client_side_validation && mailbox_id.nil? fail ArgumentError, "Missing the required parameter 'mailbox_id' when calling Mailbox.get_mailbox" end # resource path local_var_path = '/v3/mailbox/{mailbox_id}'.sub('{' + 'mailbox_id' + '}', CGI.escape(mailbox_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(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'CreateMailboxResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"Mailbox.get_mailbox", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: Mailbox#get_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#query_mailbox(opts = {}) ⇒ GetMailboxesResponse
Get mailboxes Return the mailboxes for the current user
286 287 288 289 |
# File 'lib/checkbook/api/mailbox.rb', line 286 def query_mailbox(opts = {}) data, _status_code, _headers = query_mailbox_with_http_info(opts) data end |
#query_mailbox_item(mailbox_id, opts = {}) ⇒ GetMailResponse
Get mailbox info Get mailbox items
361 362 363 364 |
# File 'lib/checkbook/api/mailbox.rb', line 361 def query_mailbox_item(mailbox_id, opts = {}) data, _status_code, _headers = query_mailbox_item_with_http_info(mailbox_id, opts) data end |
#query_mailbox_item_with_http_info(mailbox_id, opts = {}) ⇒ Array<(GetMailResponse, Integer, Hash)>
Get mailbox info Get mailbox items
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 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 |
# File 'lib/checkbook/api/mailbox.rb', line 376 def query_mailbox_item_with_http_info(mailbox_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Mailbox.query_mailbox_item ...' end # verify the required parameter 'mailbox_id' is set if @api_client.config.client_side_validation && mailbox_id.nil? fail ArgumentError, "Missing the required parameter 'mailbox_id' when calling Mailbox.query_mailbox_item" end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling Mailbox.query_mailbox_item, must be greater than or equal to 1.' end allowable_values = [10, 25, 50, 100, 250] if @api_client.config.client_side_validation && opts[:'per_page'] && !allowable_values.include?(opts[:'per_page']) fail ArgumentError, "invalid value for \"per_page\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'q'].nil? && opts[:'q'].to_s.length > 180 fail ArgumentError, 'invalid value for "opts[:"q"]" when calling Mailbox.query_mailbox_item, the character length must be smaller than or equal to 180.' end # resource path local_var_path = '/v3/mailbox/{mailbox_id}/mail'.sub('{' + 'mailbox_id' + '}', CGI.escape(mailbox_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetMailResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"Mailbox.query_mailbox_item", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: Mailbox#query_mailbox_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#query_mailbox_with_http_info(opts = {}) ⇒ Array<(GetMailboxesResponse, Integer, Hash)>
Get mailboxes Return the mailboxes for the current user
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 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 |
# File 'lib/checkbook/api/mailbox.rb', line 297 def query_mailbox_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: Mailbox.query_mailbox ...' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling Mailbox.query_mailbox, must be greater than or equal to 1.' end allowable_values = [10, 25, 50, 100, 250] if @api_client.config.client_side_validation && opts[:'per_page'] && !allowable_values.include?(opts[:'per_page']) fail ArgumentError, "invalid value for \"per_page\", must be one of #{allowable_values}" end # resource path local_var_path = '/v3/mailbox' # query parameters query_params = opts[:query_params] || {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetMailboxesResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"Mailbox.query_mailbox", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: Mailbox#query_mailbox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |