Class: Twilio::REST::Microvisor::V1::AccountConfigContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, key) ⇒ AccountConfigContext

Initialize the AccountConfigContext

Parameters:

  • version (Version)

    Version that contains the resource

  • key (String)

    The config key; up to 100 characters.



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

def initialize(version, key)
    super(version)

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

    
end

Instance Method Details

#deleteBoolean

Delete the AccountConfigInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



168
169
170
171
172
# File 'lib/twilio-ruby/rest/microvisor/v1/account_config.rb', line 168

def delete

    
    @version.delete('DELETE', @uri)
end

#fetchAccountConfigInstance

Fetch the AccountConfigInstance

Returns:



177
178
179
180
181
182
183
184
185
186
# File 'lib/twilio-ruby/rest/microvisor/v1/account_config.rb', line 177

def fetch

    
    payload = @version.fetch('GET', @uri)
    AccountConfigInstance.new(
        @version,
        payload,
        key: @solution[:key],
    )
end

#inspectObject

Provide a detailed, user friendly representation



219
220
221
222
# File 'lib/twilio-ruby/rest/microvisor/v1/account_config.rb', line 219

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

#to_sObject

Provide a user friendly representation



212
213
214
215
# File 'lib/twilio-ruby/rest/microvisor/v1/account_config.rb', line 212

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

#update(value: nil) ⇒ AccountConfigInstance

Update the AccountConfigInstance

Parameters:

  • value (String) (defaults to: nil)

    The config value; up to 4096 characters.

Returns:



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/twilio-ruby/rest/microvisor/v1/account_config.rb', line 192

def update(
    value: nil
)

    data = Twilio::Values.of({
        'Value' => value,
    })

    
    payload = @version.update('POST', @uri, data: data)
    AccountConfigInstance.new(
        @version,
        payload,
        key: @solution[:key],
    )
end