Class: Twilio::REST::Messaging::V1::DomainCertsContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Messaging::V1::DomainCertsContext
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/domain_certs.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the DomainCertsInstance.
-
#fetch ⇒ DomainCertsInstance
Fetch the DomainCertsInstance.
-
#initialize(version, domain_sid) ⇒ DomainCertsContext
constructor
Initialize the DomainCertsContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(tls_cert: nil) ⇒ DomainCertsInstance
Update the DomainCertsInstance.
Constructor Details
#initialize(version, domain_sid) ⇒ DomainCertsContext
Initialize the DomainCertsContext
49 50 51 52 53 54 55 56 57 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 49 def initialize(version, domain_sid) super(version) # Path Solution @solution = { domain_sid: domain_sid, } @uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/Certificate" end |
Instance Method Details
#delete ⇒ Boolean
Delete the DomainCertsInstance
61 62 63 64 65 66 67 68 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 61 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ DomainCertsInstance
Fetch the DomainCertsInstance
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 73 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) DomainCertsInstance.new( @version, payload, domain_sid: @solution[:domain_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
125 126 127 128 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 125 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.DomainCertsContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
118 119 120 121 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 118 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.DomainCertsContext #{context}>" end |
#update(tls_cert: nil) ⇒ DomainCertsInstance
Update the DomainCertsInstance
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 93 def update( tls_cert: nil ) data = Twilio::Values.of({ 'TlsCert' => tls_cert, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) DomainCertsInstance.new( @version, payload, domain_sid: @solution[:domain_sid], ) end |