Class: Twilio::REST::Iam::V1::OAuthAppContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Iam::V1::OAuthAppContext
- Defined in:
- lib/twilio-ruby/rest/iam/v1/o_auth_app.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the OAuthAppInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the OAuthAppInstanceMetadata.
-
#initialize(version, sid) ⇒ OAuthAppContext
constructor
Initialize the OAuthAppContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(iam_v1_account_vendor_oauth_app_update_request: nil) ⇒ OAuthAppInstance
Update the OAuthAppInstance.
-
#update_with_metadata(iam_v1_account_vendor_oauth_app_update_request: nil) ⇒ OAuthAppInstance
Update the OAuthAppInstanceMetadata.
Constructor Details
#initialize(version, sid) ⇒ OAuthAppContext
Initialize the OAuthAppContext
242 243 244 245 246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 242 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Account/OAuthApps/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the OAuthAppInstance
255 256 257 258 259 260 261 262 263 |
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 255 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the OAuthAppInstanceMetadata
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 268 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) oAuthApp_instance = OAuthAppInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) OAuthAppInstanceMetadata.new(@version, oAuthApp_instance, response.headers, response.status_code) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
342 343 344 345 |
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 342 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Iam.V1.OAuthAppContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
335 336 337 338 |
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 335 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Iam.V1.OAuthAppContext #{context}>" end |
#update(iam_v1_account_vendor_oauth_app_update_request: nil) ⇒ OAuthAppInstance
Update the OAuthAppInstance
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 288 def update(iam_v1_account_vendor_oauth_app_update_request: nil ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.update('PUT', @uri, headers: headers, data: iam_v1_account_vendor_oauth_app_update_request.to_json) OAuthAppInstance.new( @version, payload, sid: @solution[:sid], ) end |
#update_with_metadata(iam_v1_account_vendor_oauth_app_update_request: nil) ⇒ OAuthAppInstance
Update the OAuthAppInstanceMetadata
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/twilio-ruby/rest/iam/v1/o_auth_app.rb', line 309 def (iam_v1_account_vendor_oauth_app_update_request: nil ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('PUT', @uri, headers: headers, data: iam_v1_account_vendor_oauth_app_update_request.to_json) o_auth_app_instance = OAuthAppInstance.new( @version, response.body, sid: @solution[:sid], ) OAuthAppInstanceMetadata.new( @version, o_auth_app_instance, response.headers, response.status_code ) end |