Class: Twilio::REST::Messaging::V1::DomainConfigContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Messaging::V1::DomainConfigContext
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/domain_config.rb
Instance Method Summary collapse
-
#fetch ⇒ DomainConfigInstance
Fetch the DomainConfigInstance.
-
#initialize(version, domain_sid) ⇒ DomainConfigContext
constructor
Initialize the DomainConfigContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(fallback_url: :unset, callback_url: :unset, continue_on_failure: :unset, disable_https: :unset) ⇒ DomainConfigInstance
Update the DomainConfigInstance.
Constructor Details
#initialize(version, domain_sid) ⇒ DomainConfigContext
Initialize the DomainConfigContext
49 50 51 52 53 54 55 56 57 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 49 def initialize(version, domain_sid) super(version) # Path Solution @solution = { domain_sid: domain_sid, } @uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/Config" end |
Instance Method Details
#fetch ⇒ DomainConfigInstance
Fetch the DomainConfigInstance
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 61 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) DomainConfigInstance.new( @version, payload, domain_sid: @solution[:domain_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
122 123 124 125 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 122 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.DomainConfigContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
115 116 117 118 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 115 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.DomainConfigContext #{context}>" end |
#update(fallback_url: :unset, callback_url: :unset, continue_on_failure: :unset, disable_https: :unset) ⇒ DomainConfigInstance
Update the DomainConfigInstance
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_config.rb', line 84 def update( fallback_url: :unset, callback_url: :unset, continue_on_failure: :unset, disable_https: :unset ) data = Twilio::Values.of({ 'FallbackUrl' => fallback_url, 'CallbackUrl' => callback_url, 'ContinueOnFailure' => continue_on_failure, 'DisableHttps' => disable_https, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) DomainConfigInstance.new( @version, payload, domain_sid: @solution[:domain_sid], ) end |