Skip to content

Commit

Permalink
Use generated (g/s)etters instead of Lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
SMadani committed Oct 7, 2024
1 parent f968fe6 commit 8232a04
Show file tree
Hide file tree
Showing 13 changed files with 336 additions and 36 deletions.
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
<artifactId>server-sdk</artifactId>
<version>8.11.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,80 @@ else if (ex.getCause() != null) {
}
}

@lombok.Data
public static class AccountParams {
private String status, balance, country, msisdn, callerName,
currentCarrier, originalCarrier, ported, callerType;

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public String getBalance() {
return balance;
}

public void setBalance(String balance) {
this.balance = balance;
}

public String getCountry() {
return country;
}

public void setCountry(String country) {
this.country = country;
}

public String getMsisdn() {
return msisdn;
}

public void setMsisdn(String msisdn) {
this.msisdn = msisdn;
}

public String getCallerName() {
return callerName;
}

public void setCallerName(String callerName) {
this.callerName = callerName;
}

public String getCurrentCarrier() {
return currentCarrier;
}

public void setCurrentCarrier(String currentCarrier) {
this.currentCarrier = currentCarrier;
}

public String getOriginalCarrier() {
return originalCarrier;
}

public void setOriginalCarrier(String originalCarrier) {
this.originalCarrier = originalCarrier;
}

public String getPorted() {
return ported;
}

public void setPorted(String ported) {
this.ported = ported;
}

public String getCallerType() {
return callerType;
}

public void setCallerType(String callerType) {
this.callerType = callerType;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,98 @@ public String getInboundMessage(@RequestParam UUID messageId, @RequestParam long
return "{\"text\":\""+formatted+"\"}";
}

@lombok.Data
public static class MessageParams {
private UUID messageId;
private boolean sandbox;
private double latitude, longitude;
private String from, to, text, url, address, selectedChannel, selectedType;

public UUID getMessageId() {
return messageId;
}

public void setMessageId(UUID messageId) {
this.messageId = messageId;
}

public boolean isSandbox() {
return sandbox;
}

public void setSandbox(boolean sandbox) {
this.sandbox = sandbox;
}

public double getLatitude() {
return latitude;
}

public void setLatitude(double latitude) {
this.latitude = latitude;
}

public double getLongitude() {
return longitude;
}

public void setLongitude(double longitude) {
this.longitude = longitude;
}

public String getFrom() {
return from;
}

public void setFrom(String from) {
this.from = from;
}

public String getTo() {
return to;
}

public void setTo(String to) {
this.to = to;
}

public String getText() {
return text;
}

public void setText(String text) {
this.text = text;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

public String getSelectedChannel() {
return selectedChannel;
}

public void setSelectedChannel(String selectedChannel) {
this.selectedChannel = selectedChannel;
}

public String getSelectedType() {
return selectedType;
}

public void setSelectedType(String selectedType) {
this.selectedType = selectedType;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private SimSwapClient getSimSwapClient() {
@GetMapping("/simSwap")
public String simSwapStart(Model model) {
var simSwapParams = new SimSwapParams();
simSwapParams.msisdn = System.getenv("TO_NUMBER");
simSwapParams.msisdn = "+990123456";
model.addAttribute("simSwapParams", simSwapParams);
return SIM_SWAP_TEMPLATE_NAME;
}
Expand Down Expand Up @@ -61,9 +61,24 @@ public String inboundWebhook(@RequestParam String code, @RequestParam(required =
return result ? "Number matches." : "Fraudulent!";
}

@lombok.Data
public static class SimSwapParams {
private String msisdn;
private Instant date;

public String getMsisdn() {
return msisdn;
}

public void setMsisdn(String msisdn) {
this.msisdn = msisdn;
}

public Instant getDate() {
return date;
}

public void setDate(Instant date) {
this.date = date;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ public String completeRegistrationInternal(
return "<h1>Registration failed: "+reason+"</h1>";
}

@lombok.Data
public static class VerifyParams {
private boolean codeless;
private UUID requestId;
Expand All @@ -220,5 +219,101 @@ public static class VerifyParams {
toNumber, toEmail, fromNumber, fromEmail;
private Channel[] channelOptions;
private Integer codeLength;

public boolean isCodeless() {
return codeless;
}

public void setCodeless(boolean codeless) {
this.codeless = codeless;
}

public UUID getRequestId() {
return requestId;
}

public void setRequestId(UUID requestId) {
this.requestId = requestId;
}

public URI getCheckUrl() {
return checkUrl;
}

public void setCheckUrl(URI checkUrl) {
this.checkUrl = checkUrl;
}

public String getBrand() {
return brand;
}

public void setBrand(String brand) {
this.brand = brand;
}

public String getSelectedChannel() {
return selectedChannel;
}

public void setSelectedChannel(String selectedChannel) {
this.selectedChannel = selectedChannel;
}

public String getUserCode() {
return userCode;
}

public void setUserCode(String userCode) {
this.userCode = userCode;
}

public String getToNumber() {
return toNumber;
}

public void setToNumber(String toNumber) {
this.toNumber = toNumber;
}

public String getToEmail() {
return toEmail;
}

public void setToEmail(String toEmail) {
this.toEmail = toEmail;
}

public String getFromNumber() {
return fromNumber;
}

public void setFromNumber(String fromNumber) {
this.fromNumber = fromNumber;
}

public String getFromEmail() {
return fromEmail;
}

public void setFromEmail(String fromEmail) {
this.fromEmail = fromEmail;
}

public Channel[] getChannelOptions() {
return channelOptions;
}

public void setChannelOptions(Channel[] channelOptions) {
this.channelOptions = channelOptions;
}

public Integer getCodeLength() {
return codeLength;
}

public void setCodeLength(Integer codeLength) {
this.codeLength = codeLength;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,58 @@ public String eventWebhook(@RequestBody String payload) {
return standardWebhookResponse();
}

@lombok.Data
public static class VoiceCallParams {
private TextToSpeechLanguage language;
private String toPstn, tts, callId;
private boolean premium;
private Integer ringTimer;

public TextToSpeechLanguage getLanguage() {
return language;
}

public void setLanguage(TextToSpeechLanguage language) {
this.language = language;
}

public String getToPstn() {
return toPstn;
}

public void setToPstn(String toPstn) {
this.toPstn = toPstn;
}

public String getTts() {
return tts;
}

public void setTts(String tts) {
this.tts = tts;
}

public String getCallId() {
return callId;
}

public void setCallId(String callId) {
this.callId = callId;
}

public boolean isPremium() {
return premium;
}

public void setPremium(boolean premium) {
this.premium = premium;
}

public Integer getRingTimer() {
return ringTimer;
}

public void setRingTimer(Integer ringTimer) {
this.ringTimer = ringTimer;
}
}
}
Loading

0 comments on commit 8232a04

Please sign in to comment.