Skip to content

Commit

Permalink
Merge pull request #514 from bhagyasakalanka/sms-provider
Browse files Browse the repository at this point in the history
Modify SMS sender notification API to support config update without provider URL
  • Loading branch information
bhagyasakalanka authored Oct 26, 2023
2 parents dc29a6f + 246be68 commit e8d07a5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,9 @@ public SMSSenderAdd providerURL(String providerURL) {
return this;
}

@ApiModelProperty(example = "https://rest.nexmo.com/sms/json", required = true, value = "")
@ApiModelProperty(example = "https://rest.nexmo.com/sms/json", value = "")
@JsonProperty("providerURL")
@Valid
@NotNull(message = "Property providerURL cannot be null.")

public String getProviderURL() {
return providerURL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ public enum ContentTypeEnum {

private String value;

ContentTypeEnum(String v) {
value = v;
}
ContentTypeEnum(String v) {
value = v;
}

public String value() {
return value;
}
public String value() {
return value;
}

@Override
public String toString() {
Expand Down Expand Up @@ -103,11 +103,9 @@ public SMSSenderUpdateRequest providerURL(String providerURL) {
return this;
}

@ApiModelProperty(example = "https://rest.nexmo.com/sms/json", required = true, value = "")
@ApiModelProperty(example = "https://rest.nexmo.com/sms/json", value = "")
@JsonProperty("providerURL")
@Valid
@NotNull(message = "Property providerURL cannot be null.")

public String getProviderURL() {
return providerURL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ public Response createEmailSender(EmailSenderAdd emailSenderAdd) {
@Override
public Response createSMSSender(SMSSenderAdd smSSenderAdd) {

if (StringUtils.equals(getTenantDomainFromContext(), MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
return Response.status(Response.Status.METHOD_NOT_ALLOWED).build();
}
SMSSender smsSender = notificationSenderManagementService.addSMSSender(smSSenderAdd);
URI location = null;
try {
Expand Down Expand Up @@ -112,9 +109,6 @@ public Response deleteEmailSender(String senderName) {
@Override
public Response deleteSMSSender(String senderName) {

if (StringUtils.equals(getTenantDomainFromContext(), MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
return Response.status(Response.Status.METHOD_NOT_ALLOWED).build();
}
notificationSenderManagementService.deleteNotificationSender(senderName);
return Response.noContent().build();
}
Expand All @@ -140,18 +134,12 @@ public Response getEmailSenders() {
@Override
public Response getSMSSender(String senderName) {

if (StringUtils.equals(getTenantDomainFromContext(), MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
return Response.status(Response.Status.METHOD_NOT_ALLOWED).build();
}
return Response.ok().entity(notificationSenderManagementService.getSMSSender(senderName)).build();
}

@Override
public Response getSMSSenders() {

if (StringUtils.equals(getTenantDomainFromContext(), MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
return Response.status(Response.Status.METHOD_NOT_ALLOWED).build();
}
return Response.ok().entity(notificationSenderManagementService.getSMSSenders()).build();
}

Expand All @@ -169,9 +157,6 @@ public Response updateEmailSender(String senderName, EmailSenderUpdateRequest em
@Override
public Response updateSMSSender(String senderName, SMSSenderUpdateRequest smSSenderUpdateRequest) {

if (StringUtils.equals(getTenantDomainFromContext(), MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
return Response.status(Response.Status.METHOD_NOT_ALLOWED).build();
}
return Response.ok()
.entity(notificationSenderManagementService.updateSMSSender(senderName, smSSenderUpdateRequest))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,6 @@ components:
$ref: '#/components/schemas/Properties'
SMSSenderAdd:
required:
- providerURL
- provider
- contentType
type: object
Expand Down Expand Up @@ -793,7 +792,6 @@ components:
$ref: '#/components/schemas/Properties'
SMSSenderUpdateRequest:
required:
- providerURL
- provider
- contentType
type: object
Expand Down

0 comments on commit e8d07a5

Please sign in to comment.