Class: Twilio::REST::Microvisor::V1::AccountSecretContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/microvisor/v1/account_secret.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, key) ⇒ AccountSecretContext

Initialize the AccountSecretContext



157
158
159
160
161
162
163
164
165
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 157

def initialize(version, key)
    super(version)

    # Path Solution
    @solution = { key: key,  }
    @uri = "/Secrets/#{@solution[:key]}"

    
end

Instance Method Details

#deleteBoolean

Delete the AccountSecretInstance



169
170
171
172
173
174
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 169

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    @version.delete('DELETE', @uri, headers: headers)
end

#fetchAccountSecretInstance

Fetch the AccountSecretInstance



179
180
181
182
183
184
185
186
187
188
189
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 179

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

#inspectObject

Provide a detailed, user friendly representation



223
224
225
226
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 223

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Microvisor.V1.AccountSecretContext #{context}>"
end

#to_sObject

Provide a user friendly representation



216
217
218
219
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 216

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Microvisor.V1.AccountSecretContext #{context}>"
end

#update(value: nil) ⇒ AccountSecretInstance

Update the AccountSecretInstance



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 195

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