Class: Twilio::REST::Api::V2010::AccountContext::SipList::IpAccessControlListContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::SipList::IpAccessControlListContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb
Defined Under Namespace
Classes: IpAddressContext, IpAddressInstance, IpAddressList, IpAddressPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the IpAccessControlListInstance.
-
#fetch ⇒ IpAccessControlListInstance
Fetch the IpAccessControlListInstance.
-
#initialize(version, account_sid, sid) ⇒ IpAccessControlListContext
constructor
Initialize the IpAccessControlListContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#ip_addresses(sid = :unset) ⇒ IpAddressList, IpAddressContext
Access the ip_addresses.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: nil) ⇒ IpAccessControlListInstance
Update the IpAccessControlListInstance.
Constructor Details
#initialize(version, account_sid, sid) ⇒ IpAccessControlListContext
Initialize the IpAccessControlListContext
159 160 161 162 163 164 165 166 167 168 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 159 def initialize(version, account_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/SIP/IpAccessControlLists/#{@solution[:sid]}.json" # Dependents @ip_addresses = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the IpAccessControlListInstance
172 173 174 175 176 177 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 172 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ IpAccessControlListInstance
Fetch the IpAccessControlListInstance
182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 182 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) IpAccessControlListInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
247 248 249 250 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 247 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.IpAccessControlListContext #{context}>" end |
#ip_addresses(sid = :unset) ⇒ IpAddressList, IpAddressContext
Access the ip_addresses
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 222 def ip_addresses(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return IpAddressContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @ip_addresses @ip_addresses = IpAddressList.new( @version, account_sid: @solution[:account_sid], ip_access_control_list_sid: @solution[:sid], ) end @ip_addresses end |
#to_s ⇒ Object
Provide a user friendly representation
240 241 242 243 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 240 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.IpAccessControlListContext #{context}>" end |
#update(friendly_name: nil) ⇒ IpAccessControlListInstance
Update the IpAccessControlListInstance
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb', line 199 def update( friendly_name: nil ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) IpAccessControlListInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |