Class: Fusebox::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/fusebox/request.rb

Overview

Constant Summary collapse

COMMANDS =
%w(adddomain addforward changeusername checkalias checkdomain suspend enable getforward modify order terminate removealias removedomain removeforward report reportmail)

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username = nil, password = nil) ⇒ Request


29
30
31
32
33
34
35
36
# File 'lib/fusebox/request.rb', line 29

def initialize (username = nil, password = nil)
  if username && password
    @username = username
    @password = password
  else
    load_auth_from_yaml
  end
end

Class Attribute Details

.auth_yaml_pathsArray<String>


9
10
11
# File 'lib/fusebox/request.rb', line 9

def auth_yaml_paths
  @auth_yaml_paths
end

.urlString


12
13
14
# File 'lib/fusebox/request.rb', line 12

def url
  @url
end

Instance Attribute Details

#passwordString


19
20
21
# File 'lib/fusebox/request.rb', line 19

def password
  @password
end

#usernameString


16
17
18
# File 'lib/fusebox/request.rb', line 16

def username
  @username
end

Instance Method Details

#adddomain(opts) ⇒ Response

This request will add a domain to the specified account. The must be under your platform

Options Hash (opts):

  • :domain (String)

    The domain to add

  • :user (String)

    The account to add the domain to

See Also:


44
45
46
47
48
49
50
51
52
# File 'lib/fusebox/request.rb', line 44

def adddomain (opts)
  default_options = {
    :domain => '',
    :user => ''
  }

  opts.reverse_merge! default_options
  post 'adddomain', opts
end

#addforward(opts) ⇒ Response

This request will add an email forwarder.

Options Hash (opts):

  • :user (String)

    Username of FuseMail account to add forwarder to

  • :forward_what (String)

    Email address of forwarder

  • :forward_to (String)

    External email address that forwarder will send to

See Also:


61
62
63
64
65
66
67
68
69
70
# File 'lib/fusebox/request.rb', line 61

def addforward (opts)
  default_options = {
    :user => '',
    :forward_what => '',
    :forward_to => ''
  }

  opts.reverse_merge! default_options
  post 'addforward', opts
end

#changeusername(opts) ⇒ Response

This request is used to change the an account's username


93
94
95
96
97
98
99
100
101
# File 'lib/fusebox/request.rb', line 93

def changeusername (opts)
  default_options = {
    :user => '',
    :newuser => ''
  }

  opts.reverse_merge! default_options
  post 'changeusername', opts
end

#checkalias(opts) ⇒ Response

This request will check the availability of an alias against the whole system. Remember to add an alias, the domain must belong to the platform or to that account.

Options Hash (opts):

See Also:


78
79
80
81
82
83
84
85
# File 'lib/fusebox/request.rb', line 78

def checkalias (opts)
  default_options = {
    :alias => ''
  }

  opts.reverse_merge! default_options
  post 'checkalias', opts
end

#checkdomain(opts) ⇒ Response

This request will check the availability of a domain name. This only checks if the domain name is available on our system, it does not reflect registrar status.

Options Hash (opts):

  • :domain (String)

    The domain to check the availability of

See Also:


108
109
110
111
112
113
114
115
# File 'lib/fusebox/request.rb', line 108

def checkdomain (opts)
  default_options = {
    :domain => ''
  }

  opts.reverse_merge! default_options
  post 'checkdomain', opts
end

#enable(opts) ⇒ Response

The enable request allow you to activate an account under your platform or temporarily start access to the account. Below are the variables that are specific to this request.

Options Hash (opts):

  • :user (String)

    Username of FuseMail account to enable

See Also:


136
137
138
139
140
141
142
143
# File 'lib/fusebox/request.rb', line 136

def enable (opts)
  default_options = {
    :user => ''
  }

  opts.reverse_merge! default_options
  post 'enable', opts
end

#getforward(opts) ⇒ Response

This request will return the forward currently set on an alias in the Fusebox::Response#detail attribute

Options Hash (opts):

  • :user (String)

    Username of FuseMail account where the forwarding alias resides

  • :forward_what (String)

    Alias for the forwarder

See Also:


151
152
153
154
155
156
157
158
159
# File 'lib/fusebox/request.rb', line 151

def getforward (opts)
  default_options = {
    :user => '',
    :forward_what => ''
  }

  opts.reverse_merge! default_options
  post 'getforward', opts
end

#modify(opts) ⇒ Response

This request is used to modify personal information, password, and the account plan of the account. Only send the variables you wish to modify. If a NULL variable is detected, no change will be made to the account.


165
166
167
168
169
170
171
# File 'lib/fusebox/request.rb', line 165

def modify (opts)
  default_options = {
  }

  opts.reverse_merge! default_options
  post 'modify', opts
end

#order(opts) ⇒ Response

This is a request to submit a new order and create a new account under your Fused Platform account. Orders are processed within 5 minutes of request submission. Below are the variables that are specific to this type of request.

Options Hash (opts):

  • :user (String)

    Username of FuseMail account to create

  • :password (String)

    Password of FuseMail account to create

  • :first_name (String)

    First name of person

  • :last_name (String)

    Last name of person

  • :email (String)

    Other contact email address

  • :street (String)

    Street Address of person

  • :city (String)

    City of Address of person

  • :state (String)

    State of Address of person

  • :postal (String)

    Postal Code of Address of person

  • :country (String)

    Country of Address of person

  • :account_type (String) — default: 'group_subaccount'

    Type of account to create, possible options: personal_basic, personal_power, personal_ultimate, group_basic, group_power, group_ultimate, group_subaccount. See 'Account Plans' under your platform account for the API name you use.

  • :group_parent (String)

    The username of the main group account that this sub-account belongs to. This field is only required when using a group_subaccount account_type.

  • :maxdisk (String) — default: '1000'

    The maximum amount of disk space an account can consume in Megabytes (MB) (mainly used for group_subaccount's), integer only.

  • :alias (Array<String>)

    This field contains additional aliases to add to this account upon order creation.

See Also:


191
192
193
194
195
196
197
198
199
200
201
# File 'lib/fusebox/request.rb', line 191

def order (opts)
  default_options = {
    :account_type => 'group_subaccount',
    :first_name => '',
    :last_name => '',
    :maxdisk => 1000
  }

  opts.reverse_merge! default_options
  post 'order', opts
end

#removealias(opts) ⇒ Response

This request will remove a single alias from a fusemail account

Options Hash (opts):

  • :user (String)

    FuseMail user to delete alias from

  • :alias (String)

    alias to delete (e.g. [email protected] )

See Also:


225
226
227
228
229
230
231
232
233
# File 'lib/fusebox/request.rb', line 225

def removealias (opts)
  default_options = {
    :user => '',
    :alias => ''
  }

  opts.reverse_merge! default_options
  post 'removealias', opts
end

#removedomain(opts) ⇒ Response

This request will remove a domain name and all its mail aliases, auto-responders, mailing lists & forwarders associated with it. Please see below for the specific requirements for this request.

Options Hash (opts):

  • :domain (String)

    The domain to delete

  • :confirm (Boolean) — default: true

    This must be set to true to confirm that you understand all aliases, auto-responders, mailing lists & forwarders with this domain will be permanently deleted.

See Also:


241
242
243
244
245
246
247
248
249
# File 'lib/fusebox/request.rb', line 241

def removedomain (opts)
  default_options = {
    :domain => '',
    :confirm => true
  }

  opts.reverse_merge! default_options
  post 'removedomain', opts
end

#removeforward(opts) ⇒ Response

This request will remove an existing email forwarder

Options Hash (opts):

  • :user (String)

    Username of FuseMail account to remove forwarder to

  • :forward_what (String)

    Email address of forwarder

  • :forward_to (String)

    External email address that forwarder will send to

See Also:


259
260
261
262
263
264
265
266
267
268
# File 'lib/fusebox/request.rb', line 259

def removeforward (opts)
  default_options = {
    :user => '',
    :forward_what => '',
    :forward_to => ''
  }

  opts.reverse_merge! default_options
  post 'removeforward', opts
end

#report(opts = {}) ⇒ Response

This request will provide information about one or more accounts under your platform in CSV format

Options Hash (opts):

  • :user (String) — default: 'all'

    The username you wish to query for information; you may also enter the username “all” to get information about all users under your platform

  • :group_subaccount (Boolean) — default: true

    Provide information not only for the Group Administration account but also for the group sub-accounts under the Group Administration account

  • :report_type ('basic', 'extended') — default: 'basic'

    Level of detailed in returned results

See Also:


277
278
279
280
281
282
283
284
285
286
# File 'lib/fusebox/request.rb', line 277

def report (opts = {})
  default_options = {
    :user => 'all',
    :group_subaccount => true,
    :report_type => 'basic'
  }

  opts.reverse_merge! default_options
  post 'report', opts, "report_#{opts[:report_type]}".to_sym
end

#reportmail(opts = {}) ⇒ Response

This request will provide information about mail aliases, forwarders, autoresponders, or mailing lists on one or more accounts under your platform in CSV format.

Options Hash (opts):

  • :user (String) — default: 'all'

    The username you wish to query for information; you may also enter the username “all” to get information about all users under your platform

  • :group_subaccount (Boolean) — default: true

    Provide information not only for the Group Administration account but also for the group sub-accounts under the Group Administration account

  • :report_type ('all', 'alias', 'forwarder', 'autorespond', 'mailinglist') — default: 'all'
    • 'all' = Provide aliases, forwarders, autoresponders, and mailing list info

    • 'alias' = Provide only alias information

    • 'forwarder' = Provide only fowarder information

    • 'autorespond' = Provide only autoresponder information

    • 'mailinglist' = Provide only mailing list information

See Also:


300
301
302
303
304
305
306
307
308
309
# File 'lib/fusebox/request.rb', line 300

def reportmail (opts = {})
  default_options = {
    :user => 'all',
    :group_subaccount => true,
    :report_type => 'all'
  }

  opts.reverse_merge! default_options
  post 'reportmail', opts, :reportmail
end

#suspend(opts) ⇒ Response

The suspend request allow you to suspend an account under your platform or temporarily stop access to the account without deleting any of the accounts data. Below are the variables that are specific to this request.

Options Hash (opts):

  • :user (String)

    Username of FuseMail account to suspend

See Also:


122
123
124
125
126
127
128
129
# File 'lib/fusebox/request.rb', line 122

def suspend (opts)
  default_options = {
    :user => '',
  }

  opts.reverse_merge! default_options
  post 'suspend', opts
end

#terminate(opts) ⇒ Response

The terminate request is used to permanently remove an account and all of the account data associated with it. This operation cannot be reversed and therefore should be used with caution.

Options Hash (opts):

  • :user (String)

    Username of FuseMail account to terminate

  • :purge (Boolean) — default: false

    Will purge all data (such as removing the username) from our system. This process might take a few hours to complete.

See Also:


209
210
211
212
213
214
215
216
217
# File 'lib/fusebox/request.rb', line 209

def terminate (opts)
  default_options = {
    :user => '',
    :purge => false
  }

  opts.reverse_merge! default_options
  post 'terminate', opts
end