Class: Twilio::REST::Bulkexports::V1::ExportConfigurationContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Bulkexports::V1::ExportConfigurationContext
- Defined in:
- lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb
Instance Method Summary collapse
-
#fetch ⇒ ExportConfigurationInstance
Fetch the ExportConfigurationInstance.
-
#fetch_with_metadata ⇒ ExportConfigurationInstance
Fetch the ExportConfigurationInstanceMetadata.
-
#initialize(version, resource_type) ⇒ ExportConfigurationContext
constructor
Initialize the ExportConfigurationContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(enabled: :unset, webhook_url: :unset, webhook_method: :unset) ⇒ ExportConfigurationInstance
Update the ExportConfigurationInstance.
-
#update_with_metadata(enabled: :unset, webhook_url: :unset, webhook_method: :unset) ⇒ ExportConfigurationInstance
Update the ExportConfigurationInstanceMetadata.
Constructor Details
#initialize(version, resource_type) ⇒ ExportConfigurationContext
Initialize the ExportConfigurationContext
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 50 def initialize(version, resource_type) super(version) # Path Solution @solution = { resource_type: resource_type, } @uri = "/Exports/#{@solution[:resource_type]}/Configuration" end |
Instance Method Details
#fetch ⇒ ExportConfigurationInstance
Fetch the ExportConfigurationInstance
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 63 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ExportConfigurationInstance.new( @version, payload, resource_type: @solution[:resource_type], ) end |
#fetch_with_metadata ⇒ ExportConfigurationInstance
Fetch the ExportConfigurationInstanceMetadata
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 82 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) export_configuration_instance = ExportConfigurationInstance.new( @version, response.body, resource_type: @solution[:resource_type], ) ExportConfigurationInstanceMetadata.new( @version, export_configuration_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
184 185 186 187 |
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 184 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Bulkexports.V1.ExportConfigurationContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
177 178 179 180 |
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 177 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Bulkexports.V1.ExportConfigurationContext #{context}>" end |
#update(enabled: :unset, webhook_url: :unset, webhook_method: :unset) ⇒ ExportConfigurationInstance
Update the ExportConfigurationInstance
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 110 def update( enabled: :unset, webhook_url: :unset, webhook_method: :unset ) data = Twilio::Values.of({ 'Enabled' => enabled, 'WebhookUrl' => webhook_url, 'WebhookMethod' => webhook_method, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ExportConfigurationInstance.new( @version, payload, resource_type: @solution[:resource_type], ) end |
#update_with_metadata(enabled: :unset, webhook_url: :unset, webhook_method: :unset) ⇒ ExportConfigurationInstance
Update the ExportConfigurationInstanceMetadata
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 142 def ( enabled: :unset, webhook_url: :unset, webhook_method: :unset ) data = Twilio::Values.of({ 'Enabled' => enabled, 'WebhookUrl' => webhook_url, 'WebhookMethod' => webhook_method, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) export_configuration_instance = ExportConfigurationInstance.new( @version, response.body, resource_type: @solution[:resource_type], ) ExportConfigurationInstanceMetadata.new( @version, export_configuration_instance, response.headers, response.status_code ) end |