Class: Twilio::REST::Microvisor::V1::AccountSecretContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Microvisor::V1::AccountSecretContext
- Defined in:
- lib/twilio-ruby/rest/microvisor/v1/account_secret.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the AccountSecretInstance.
-
#fetch ⇒ AccountSecretInstance
Fetch the AccountSecretInstance.
-
#initialize(version, key) ⇒ AccountSecretContext
constructor
Initialize the AccountSecretContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(value: nil) ⇒ AccountSecretInstance
Update the AccountSecretInstance.
Constructor Details
#initialize(version, key) ⇒ AccountSecretContext
Initialize the AccountSecretContext
164 165 166 167 168 169 170 171 172 |
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 164 def initialize(version, key) super(version) # Path Solution @solution = { key: key, } @uri = "/Secrets/#{@solution[:key]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the AccountSecretInstance
176 177 178 179 180 181 182 183 |
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 176 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ AccountSecretInstance
Fetch the AccountSecretInstance
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 188 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) AccountSecretInstance.new( @version, payload, key: @solution[:key], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
240 241 242 243 |
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 240 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Microvisor.V1.AccountSecretContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
233 234 235 236 |
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 233 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Microvisor.V1.AccountSecretContext #{context}>" end |
#update(value: nil) ⇒ AccountSecretInstance
Update the AccountSecretInstance
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 208 def update( value: nil ) data = Twilio::Values.of({ 'Value' => value, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) AccountSecretInstance.new( @version, payload, key: @solution[:key], ) end |