Class: Twilio::REST::Accounts::V1::CredentialList::PublicKeyContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Accounts::V1::CredentialList::PublicKeyContext
- Defined in:
- lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the PublicKeyInstance.
-
#fetch ⇒ PublicKeyInstance
Fetch the PublicKeyInstance.
-
#initialize(version, sid) ⇒ PublicKeyContext
constructor
Initialize the PublicKeyContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset) ⇒ PublicKeyInstance
Update the PublicKeyInstance.
Constructor Details
#initialize(version, sid) ⇒ PublicKeyContext
Initialize the PublicKeyContext
162 163 164 165 166 167 168 169 170 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 162 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Credentials/PublicKeys/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the PublicKeyInstance
174 175 176 177 178 179 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 174 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ PublicKeyInstance
Fetch the PublicKeyInstance
184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 184 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) PublicKeyInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
228 229 230 231 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 228 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Accounts.V1.PublicKeyContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
221 222 223 224 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 221 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Accounts.V1.PublicKeyContext #{context}>" end |
#update(friendly_name: :unset) ⇒ PublicKeyInstance
Update the PublicKeyInstance
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb', line 200 def update( friendly_name: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) PublicKeyInstance.new( @version, payload, sid: @solution[:sid], ) end |