1 | /* |
2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
3 | * contributor license agreements. See the NOTICE file distributed with |
4 | * this work for additional information regarding copyright ownership. |
5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
6 | * (the "License"); you may not use this file except in compliance with |
7 | * the License. You may obtain a copy of the License at |
8 | * |
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
10 | * |
11 | * Unless required by applicable law or agreed to in writing, software |
12 | * distributed under the License is distributed on an "AS IS" BASIS, |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | * See the License for the specific language governing permissions and |
15 | * limitations under the License. |
16 | */ |
17 | package org.jclouds.glesys.options; |
18 | |
19 | import org.jclouds.http.options.BaseHttpRequestOptions; |
20 | |
21 | /** |
22 | * @author Adam Lowe |
23 | * @see <a href="https://customer.glesys.com/api.php?a=doc#email_createaccount" /> |
24 | */ |
25 | public class CreateAccountOptions extends BaseHttpRequestOptions { |
26 | public static class Builder { |
27 | /** |
28 | * @see CreateAccountOptions#antispamLevel |
29 | */ |
30 | public static CreateAccountOptions antispamLevel(int antispamLevel) { |
31 | return new CreateAccountOptions().antispamLevel(antispamLevel); |
32 | } |
33 | |
34 | /** |
35 | * @see CreateAccountOptions#antiVirus |
36 | */ |
37 | public static CreateAccountOptions antiVirus(boolean antiVirus) { |
38 | return new CreateAccountOptions().antiVirus(antiVirus); |
39 | } |
40 | |
41 | /** |
42 | * @see CreateAccountOptions#autorespond |
43 | */ |
44 | public static CreateAccountOptions autorespond(boolean autorespond) { |
45 | return new CreateAccountOptions().autorespond(autorespond); |
46 | } |
47 | |
48 | /** |
49 | * @see CreateAccountOptions#autorespondSaveEmail |
50 | */ |
51 | public static CreateAccountOptions autorespondSaveEmail(boolean autorespondSaveEmail) { |
52 | return new CreateAccountOptions().autorespondSaveEmail(autorespondSaveEmail); |
53 | } |
54 | |
55 | /** |
56 | * @see CreateAccountOptions#autorespondMessage |
57 | */ |
58 | public static CreateAccountOptions autorespondMessage(String autorespondMessage) { |
59 | return new CreateAccountOptions().autorespondMessage(autorespondMessage); |
60 | } |
61 | } |
62 | |
63 | /** Configure the antispam level of the account */ |
64 | public CreateAccountOptions antispamLevel(int antispamLevel) { |
65 | formParameters.put("antispamlevel", Integer.toString(antispamLevel)); |
66 | return this; |
67 | } |
68 | |
69 | /** Enable or disable virus checking */ |
70 | public CreateAccountOptions antiVirus(boolean antiVirus) { |
71 | formParameters.put("antivirus", Boolean.toString(antiVirus)); |
72 | return this; |
73 | } |
74 | |
75 | /** Enable or disable auto-respond */ |
76 | public CreateAccountOptions autorespond(boolean autorespond) { |
77 | formParameters.put("autorespond", Boolean.toString(autorespond)); |
78 | return this; |
79 | } |
80 | |
81 | /** Enable or disable saving of auto-respond e-mails */ |
82 | public CreateAccountOptions autorespondSaveEmail(boolean autorespondSaveEmail) { |
83 | formParameters.put("autorespondsaveemail", Boolean.toString(autorespondSaveEmail)); |
84 | return this; |
85 | } |
86 | |
87 | /** Configure the auto-respond message */ |
88 | public CreateAccountOptions autorespondMessage(String autorespondMessage) { |
89 | formParameters.put("autorespondmessage", autorespondMessage); |
90 | return this; |
91 | } |
92 | } |