Class: Mailtrap::InboundFoldersAPI

Inherits:
Object
  • Object
show all
Includes:
BaseAPI
Defined in:
lib/mailtrap/inbound_folders_api.rb

Instance Attribute Summary

Attributes included from BaseAPI

#account_id, #client

Instance Method Summary collapse

Methods included from BaseAPI

included

Constructor Details

#initialize(client = Mailtrap::Client.new) ⇒ InboundFoldersAPI

Inbound is scoped to the token's account, so no account_id is required.

Parameters:

  • client (Mailtrap::Client) (defaults to: Mailtrap::Client.new)

    The client instance



15
16
17
# File 'lib/mailtrap/inbound_folders_api.rb', line 15

def initialize(client = Mailtrap::Client.new)
  @client = client
end

Instance Method Details

#create(options) ⇒ InboundFolder

Creates a new inbound folder

Parameters:

  • options (Hash)

    The parameters to create

Options Hash (options):

  • :name (String)

    The folder name

Returns:

Raises:



40
41
42
# File 'lib/mailtrap/inbound_folders_api.rb', line 40

def create(options)
  base_create(options)
end

#delete(folder_id) ⇒ Object

Deletes an inbound folder along with all of its inboxes

Parameters:

  • folder_id (Integer)

    The folder ID

Returns:

  • nil

Raises:



59
60
61
# File 'lib/mailtrap/inbound_folders_api.rb', line 59

def delete(folder_id)
  base_delete(folder_id)
end

#get(folder_id) ⇒ InboundFolder

Retrieves a specific inbound folder

Parameters:

  • folder_id (Integer)

    The folder ID

Returns:

Raises:



30
31
32
# File 'lib/mailtrap/inbound_folders_api.rb', line 30

def get(folder_id)
  base_get(folder_id)
end

#listArray<InboundFolder>

Lists all inbound folders in the account

Returns:

Raises:



22
23
24
# File 'lib/mailtrap/inbound_folders_api.rb', line 22

def list
  base_list
end

#update(folder_id, options) ⇒ InboundFolder

Updates an inbound folder

Parameters:

  • folder_id (Integer)

    The folder ID

  • options (Hash)

    The parameters to update

Options Hash (options):

  • :name (String)

    The folder name

Returns:

Raises:



51
52
53
# File 'lib/mailtrap/inbound_folders_api.rb', line 51

def update(folder_id, options)
  base_update(folder_id, options)
end