Class: Twilio::REST::Messaging::V1::DomainCertsContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/domain_certs.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, domain_sid) ⇒ DomainCertsContext

Initialize the DomainCertsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • domain_sid (String)

    Unique string used to identify the domain that this certificate should be associated with.



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

#deleteBoolean

Delete the DomainCertsInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



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

#fetchDomainCertsInstance

Fetch the DomainCertsInstance

Returns:



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

#inspectObject

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_sObject

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

Parameters:

  • tls_cert (String) (defaults to: nil)

    Contains the full TLS certificate and private for this domain in PEM format: en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain.

Returns:



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