aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/main/java/org/sonarqube/ws/client/emails/WsEmailConfiguration.java
blob: bb547b36c6a7557bfd7b0b20cfbe0d1ae2a189eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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
/*
 * SonarQube
 * Copyright (C) 2009-2025 SonarSource SA
 * mailto:info AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
package org.sonarqube.ws.client.emails;

public record WsEmailConfiguration(
  String host,
  String port,
  String securityProtocol,
  String fromAddress,
  String fromName,
  String subjectPrefix,
  String authMethod,
  String username,
  String basicPassword,
  String oauthAuthenticationHost,
  String oauthClientId,
  String oauthClientSecret,
  String oauthTenant
  ) {

  public static WsEmailConfigurationBuilder builder() {
    return new WsEmailConfigurationBuilder();
  }

  public static final class WsEmailConfigurationBuilder {
    private String host;
    private String port;
    private String securityProtocol;
    private String fromAddress;
    private String fromName;
    private String subjectPrefix;
    private String authMethod;
    private String username;
    private String basicPassword;
    private String oauthAuthenticationHost;
    private String oauthClientId;
    private String oauthClientSecret;
    private String oauthTenant;

    private WsEmailConfigurationBuilder() {
    }

    public WsEmailConfigurationBuilder host(String host) {
      this.host = host;
      return this;
    }

    public WsEmailConfigurationBuilder port(String port) {
      this.port = port;
      return this;
    }

    public WsEmailConfigurationBuilder securityProtocol(String securityProtocol) {
      this.securityProtocol = securityProtocol;
      return this;
    }

    public WsEmailConfigurationBuilder fromAddress(String fromAddress) {
      this.fromAddress = fromAddress;
      return this;
    }

    public WsEmailConfigurationBuilder fromName(String fromName) {
      this.fromName = fromName;
      return this;
    }

    public WsEmailConfigurationBuilder subjectPrefix(String subjectPrefix) {
      this.subjectPrefix = subjectPrefix;
      return this;
    }

    public WsEmailConfigurationBuilder authMethod(String authMethod) {
      this.authMethod = authMethod;
      return this;
    }

    public WsEmailConfigurationBuilder username(String username) {
      this.username = username;
      return this;
    }

    public WsEmailConfigurationBuilder basicPassword(String basicPassword) {
      this.basicPassword = basicPassword;
      return this;
    }

    public WsEmailConfigurationBuilder oauthAuthenticationHost(String oauthAuthenticationHost) {
      this.oauthAuthenticationHost = oauthAuthenticationHost;
      return this;
    }

    public WsEmailConfigurationBuilder oauthClientId(String oauthClientId) {
      this.oauthClientId = oauthClientId;
      return this;
    }

    public WsEmailConfigurationBuilder oauthClientSecret(String oauthClientSecret) {
      this.oauthClientSecret = oauthClientSecret;
      return this;
    }

    public WsEmailConfigurationBuilder oauthTenant(String oauthTenant) {
      this.oauthTenant = oauthTenant;
      return this;
    }

    public WsEmailConfiguration build() {
      return new WsEmailConfiguration(host, port, securityProtocol, fromAddress, fromName, subjectPrefix, authMethod, username, basicPassword, oauthAuthenticationHost, oauthClientId, oauthClientSecret, oauthTenant);
    }
  }
}