001 002/* 003 * Copyright (C) 2011 Archie L. Cobbs. All rights reserved. 004 * 005 * $Id$ 006 */ 007 008package org.dellroad.jibxbindings.twilio.restapi; 009 010import java.net.URI; 011 012import org.dellroad.jibxbindings.twilio.Method; 013 014/** 015 * Represents an <code><IncomingPhoneNumber></code>. 016 */ 017public class IncomingPhoneNumber extends NumberedAccountResource implements TwilioResponseContent { 018 019 private APIVersion apiVersion; 020 private URI voiceURL; 021 private Method voiceMethod; 022 private URI voiceFallbackURL; 023 private Method voiceFallbackMethod; 024 private URI statusCallback; 025 private Method statusCallbackMethod; 026 private URI smsURL; 027 private Method smsMethod; 028 private URI smsFallbackURL; 029 private Method smsFallbackMethod; 030 private Capabilities capabilities; 031 private boolean voiceCallerIdLookup; 032 033 /** 034 * Calls to this phone number will start a new TwiML session with this API version. 035 */ 036 public APIVersion getAPIVersion() { 037 return this.apiVersion; 038 } 039 public void setAPIVersion(APIVersion apiVersion) { 040 this.apiVersion = apiVersion; 041 } 042 043 /** 044 * The URL that Twilio should request when somebody dials the phone number. 045 */ 046 public URI getVoiceURL() { 047 return this.voiceURL; 048 } 049 public void setVoiceURL(URI voiceURL) { 050 this.voiceURL = voiceURL; 051 } 052 053 /** 054 * The HTTP method to use when requesting the {@link #getVoiceURL voice URL}. 055 */ 056 public Method getVoiceMethod() { 057 return this.voiceMethod; 058 } 059 public void setVoiceMethod(Method voiceMethod) { 060 this.voiceMethod = voiceMethod; 061 } 062 063 /** 064 * A URL that Twilio will request if an error occurs requesting or executing the TwiML 065 * defined by the {@link #getVoiceURL voice URL}. 066 */ 067 public URI getVoiceFallbackURL() { 068 return this.voiceFallbackURL; 069 } 070 public void setVoiceFallbackURL(URI voiceFallbackURL) { 071 this.voiceFallbackURL = voiceFallbackURL; 072 } 073 074 /** 075 * The HTTP method to use when requesting the {@link #getVoiceFallbackURL voice fallback URL}. 076 */ 077 public Method getVoiceFallbackMethod() { 078 return this.voiceFallbackMethod; 079 } 080 public void setVoiceFallbackMethod(Method voiceFallbackMethod) { 081 this.voiceFallbackMethod = voiceFallbackMethod; 082 } 083 084 /** 085 * The URL that Twilio will request to pass status parameters (such as call ended) to your application. 086 */ 087 public URI getStatusCallback() { 088 return this.statusCallback; 089 } 090 public void setStatusCallback(URI statusCallback) { 091 this.statusCallback = statusCallback; 092 } 093 094 /** 095 * The HTTP method to use when requesting the {@link #getStatusCallback status callback URL}. 096 */ 097 public Method getStatusCallbackMethod() { 098 return this.statusCallbackMethod; 099 } 100 public void setStatusCallbackMethod(Method statusCallbackMethod) { 101 this.statusCallbackMethod = statusCallbackMethod; 102 } 103 104 /** 105 * The URL that Twilio should request when somebody sends an SMS to the new phone number. 106 */ 107 public URI getSMSURL() { 108 return this.smsURL; 109 } 110 public void setSMSURL(URI smsURL) { 111 this.smsURL = smsURL; 112 } 113 114 /** 115 * The HTTP method to use when requesting the {@link #getSMSURL SMS URL}. 116 */ 117 public Method getSMSMethod() { 118 return this.smsMethod; 119 } 120 public void setSMSMethod(Method smsMethod) { 121 this.smsMethod = smsMethod; 122 } 123 124 /** 125 * A URL that Twilio will request if an error occurs requesting or executing the TwiML 126 * defined by the {@link #getSMSURL SMS URL}. 127 */ 128 public URI getSMSFallbackURL() { 129 return this.smsFallbackURL; 130 } 131 public void setSMSFallbackURL(URI smsFallbackURL) { 132 this.smsFallbackURL = smsFallbackURL; 133 } 134 135 /** 136 * The HTTP method to use when requesting the {@link #getSMSFallbackURL SMS fallback URL}. 137 */ 138 public Method getSMSFallbackMethod() { 139 return this.smsFallbackMethod; 140 } 141 public void setSMSFallbackMethod(Method smsFallbackMethod) { 142 this.smsFallbackMethod = smsFallbackMethod; 143 } 144 145 public Capabilities getCapabilities() { 146 return this.capabilities; 147 } 148 public void setCapabilities(Capabilities capabilities) { 149 this.capabilities = capabilities; 150 } 151 152 /** 153 * Do a lookup of a caller's name from the CNAM database and post it to your app? 154 */ 155 public boolean isVoiceCallerIdLookup() { 156 return this.voiceCallerIdLookup; 157 } 158 public void setVoiceCallerIdLookup(boolean voiceCallerIdLookup) { 159 this.voiceCallerIdLookup = voiceCallerIdLookup; 160 } 161} 162