001/* 002 * Copyright 2020 Vonage 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package com.vonage.client.account; 017 018public class SettingsRequest { 019 private String incomingSmsUrl; 020 private String deliveryReceiptUrl; 021 022 /** 023 * @param incomingSmsUrl The URL where Vonage will send a webhook when an incoming SMS is received when a 024 * number-specific URL is not configured. Set to an empty string to unset the value. 025 * @param deliveryReceiptUrl The URL where Vonage will send a webhook when an incoming SMS is received when a 026 * number-specific URL is not configured. Set to an empty string to unset the value. 027 */ 028 public SettingsRequest(String incomingSmsUrl, String deliveryReceiptUrl) { 029 this.incomingSmsUrl = incomingSmsUrl; 030 this.deliveryReceiptUrl = deliveryReceiptUrl; 031 } 032 033 /** 034 * @param incomingSmsUrl The URL where Vonage will send a webhook when an incoming SMS is received when a 035 * number-specific URL is not configured. Set to an empty string to unset the value. 036 * 037 * @return An SettingsRequest with only the incoming SMS URL set. 038 */ 039 public static SettingsRequest withIncomingSmsUrl(String incomingSmsUrl) { 040 return new SettingsRequest(incomingSmsUrl, null); 041 } 042 043 /** 044 * @param deliveryReceiptUrl The URL where Vonage will send a webhook when an incoming SMS is received when a 045 * number-specific URL is not configured. Set to an empty string to unset the value. 046 * 047 * @return An SettingsRequest with only the delivery receipt URL set. 048 */ 049 public static SettingsRequest withDeliveryReceiptUrl(String deliveryReceiptUrl) { 050 return new SettingsRequest(null, deliveryReceiptUrl); 051 } 052 053 /** 054 * @return The URL where Vonage will send a webhook when an incoming SMS is received when a number-specific URL is 055 * not configured. 056 */ 057 public String getIncomingSmsUrl() { 058 return incomingSmsUrl; 059 } 060 061 /** 062 * @return The URL where Vonage will send a webhook when a delivery receipt is received when a number-specific URL is 063 * not configured. 064 */ 065 public String getDeliveryReceiptUrl() { 066 return deliveryReceiptUrl; 067 } 068}