Class: Twilio::REST::Lookups::V2::BucketInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/lookups/v2/bucket.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, field: nil, bucket: nil) ⇒ BucketInstance

Initialize the BucketInstance



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 184

def initialize(version, payload , field: nil, bucket: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'code' => payload['code'],
        'message' => payload['message'],
        'more_info' => payload['more_info'],
        'status' => payload['status'],
        'field' => payload['field'],
        'limit' => payload['limit'],
        'bucket' => payload['bucket'],
        'owner' => payload['owner'],
        'ttl' => payload['ttl'],
    }

    # Context
    @instance_context = nil
    @params = { 'field' => field  || @properties['field']  ,'bucket' => bucket  || @properties['bucket']  , }
end

Instance Method Details

#bucketString



254
255
256
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 254

def bucket
    @properties['bucket']
end

#codeString



218
219
220
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 218

def code
    @properties['code']
end

#contextBucketContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



209
210
211
212
213
214
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 209

def context
    unless @instance_context
        @instance_context = BucketContext.new(@version , @params['field'], @params['bucket'])
    end
    @instance_context
end

#deleteBoolean

Delete the BucketInstance



273
274
275
276
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 273

def delete

    context.delete
end

#fetchBucketInstance

Fetch the BucketInstance



281
282
283
284
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 281

def fetch

    context.fetch
end

#fieldString



242
243
244
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 242

def field
    @properties['field']
end

#inspectObject

Provide a detailed, user friendly representation



306
307
308
309
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 306

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Lookups.V2.BucketInstance #{values}>"
end

#limitString



248
249
250
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 248

def limit
    @properties['limit']
end

#messageString



224
225
226
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 224

def message
    @properties['message']
end

#more_infoString



230
231
232
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 230

def more_info
    @properties['more_info']
end

#ownerString



260
261
262
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 260

def owner
    @properties['owner']
end

#statusString



236
237
238
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 236

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



299
300
301
302
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 299

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Lookups.V2.BucketInstance #{values}>"
end

#ttlString



266
267
268
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 266

def ttl
    @properties['ttl']
end

#update(rate_limit_request: :unset) ⇒ BucketInstance

Update the BucketInstance



290
291
292
293
294
295
# File 'lib/twilio-ruby/rest/lookups/v2/bucket.rb', line 290

def update(rate_limit_request: :unset
)

    context.update(
    )
end