Class: Twilio::REST::Preview::Marketplace::InstalledAddOnContext::InstalledAddOnExtensionContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Marketplace::InstalledAddOnContext::InstalledAddOnExtensionContext
- Defined in:
- lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
Instance Method Summary collapse
-
#fetch ⇒ InstalledAddOnExtensionInstance
Fetch the InstalledAddOnExtensionInstance.
-
#initialize(version, installed_add_on_sid, sid) ⇒ InstalledAddOnExtensionContext
constructor
Initialize the InstalledAddOnExtensionContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(enabled: nil) ⇒ InstalledAddOnExtensionInstance
Update the InstalledAddOnExtensionInstance.
Constructor Details
#initialize(version, installed_add_on_sid, sid) ⇒ InstalledAddOnExtensionContext
Initialize the InstalledAddOnExtensionContext
139 140 141 142 143 144 145 146 147 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb', line 139 def initialize(version, installed_add_on_sid, sid) super(version) # Path Solution @solution = { installed_add_on_sid: installed_add_on_sid, sid: sid, } @uri = "/InstalledAddOns/#{@solution[:installed_add_on_sid]}/Extensions/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ InstalledAddOnExtensionInstance
Fetch the InstalledAddOnExtensionInstance
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb', line 151 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) InstalledAddOnExtensionInstance.new( @version, payload, installed_add_on_sid: @solution[:installed_add_on_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
205 206 207 208 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb', line 205 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Marketplace.InstalledAddOnExtensionContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
198 199 200 201 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb', line 198 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Marketplace.InstalledAddOnExtensionContext #{context}>" end |
#update(enabled: nil) ⇒ InstalledAddOnExtensionInstance
Update the InstalledAddOnExtensionInstance
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb', line 172 def update( enabled: nil ) data = Twilio::Values.of({ 'Enabled' => enabled, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) InstalledAddOnExtensionInstance.new( @version, payload, installed_add_on_sid: @solution[:installed_add_on_sid], sid: @solution[:sid], ) end |