Class: Twilio::REST::FlexApi::V1::ConfigurationContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::FlexApi::V1::ConfigurationContext
- Defined in:
- lib/twilio-ruby/rest/flex_api/v1/configuration.rb
Instance Method Summary collapse
-
#fetch(ui_version: :unset) ⇒ ConfigurationInstance
Fetch the ConfigurationInstance.
-
#initialize(version) ⇒ ConfigurationContext
constructor
Initialize the ConfigurationContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(body: :unset) ⇒ ConfigurationInstance
Update the ConfigurationInstance.
Constructor Details
#initialize(version) ⇒ ConfigurationContext
Initialize the ConfigurationContext
48 49 50 51 52 53 54 55 56 |
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 48 def initialize(version) super(version) # Path Solution @solution = { } @uri = "/Configuration" end |
Instance Method Details
#fetch(ui_version: :unset) ⇒ ConfigurationInstance
Fetch the ConfigurationInstance
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 61 def fetch( ui_version: :unset ) params = Twilio::Values.of({ 'UiVersion' => ui_version, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) ConfigurationInstance.new( @version, payload, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
111 112 113 114 |
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 111 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.ConfigurationContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
104 105 106 107 |
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 104 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.ConfigurationContext #{context}>" end |
#update(body: :unset) ⇒ ConfigurationInstance
Update the ConfigurationInstance
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 85 def update(body: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.update('POST', @uri, headers: headers, data: body.to_json) ConfigurationInstance.new( @version, payload, ) end |