Class: Twilio::REST::Conversations::V2::ConfigurationContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v2/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, id) ⇒ ConfigurationContext

Initialize the ConfigurationContext

Parameters:

  • Version that contains the resource



1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1201

def initialize(version, id)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)

    # Path Solution
    @solution = { id: id,  }
    @uri = "/ControlPlane/Configurations/#{@solution[:id]}"

    
end

Instance Method Details

#delete(idempotency_key: :unset) ⇒ Boolean

Delete the ConfigurationInstance

Parameters:

  • (defaults to: :unset)

    Client-generated UUID key to ensure idempotent behavior. Submitting the same key returns the original response without creating a duplicate operation. Keys are scoped to account + region with a 24-hour TTL.

Returns:

  • True if delete succeeds, false otherwise



1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1216

def delete(
  idempotency_key: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Idempotency-Key' => idempotency_key, })
    
    
    
    response = @version.('DELETE', @uri, headers: headers)
    ConfigurationInstance.new(
      @version,
      response.body,
        id: @solution[:id],
    )
    
end

#delete_with_metadata(idempotency_key: :unset) ⇒ Boolean

Delete the ConfigurationInstanceMetadata

Parameters:

  • (defaults to: :unset)

    Client-generated UUID key to ensure idempotent behavior. Submitting the same key returns the original response without creating a duplicate operation. Keys are scoped to account + region with a 24-hour TTL.

Returns:

  • True if delete succeeds, false otherwise



1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1237

def (
  idempotency_key: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Idempotency-Key' => idempotency_key, })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      configuration_instance = ConfigurationInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      ConfigurationInstanceMetadata.new(@version, configuration_instance, response.headers, response.status_code)
end

#fetch ⇒ ConfigurationInstance

Fetch the ConfigurationInstance

Returns:

  • Fetched ConfigurationInstance



1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1258

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    ConfigurationInstance.new(
        @version,
        payload,
        id: @solution[:id],
    )
end

#fetch_with_metadata ⇒ ConfigurationInstance

Fetch the ConfigurationInstanceMetadata

Returns:

  • Fetched ConfigurationInstance



1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1277

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    configuration_instance = ConfigurationInstance.new(
        @version,
        response.body,
        id: @solution[:id],
    )
    ConfigurationInstanceMetadata.new(
        @version,
        configuration_instance,
        response.headers,
        response.status_code
    )
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



1417
1418
1419
1420
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1417

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

#patch(idempotency_key: :unset, patch_configuration_request: :unset) ⇒ ConfigurationInstance

Patch the ConfigurationInstance

Parameters:

  • (defaults to: :unset)

    Client-generated UUID key to ensure idempotent behavior. Submitting the same key returns the original response without creating a duplicate operation. Keys are scoped to account + region with a 24-hour TTL.

  • (defaults to: :unset)

    The partial configuration update.

Returns:

  • Patched ConfigurationInstance



1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1304

def patch(
  idempotency_key: :unset,
  patch_configuration_request: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Idempotency-Key' => idempotency_key, })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    payload = @version.patch('PATCH', @uri, headers: headers, data: patch_configuration_request.to_json)
    ConfigurationInstance.new(
        @version,
        payload,
        id: @solution[:id],
    )
end

#patch_with_metadata(idempotency_key: :unset, patch_configuration_request: :unset) ⇒ ConfigurationInstance

Patch the ConfigurationInstanceMetadata

Parameters:

  • (defaults to: :unset)

    Client-generated UUID key to ensure idempotent behavior. Submitting the same key returns the original response without creating a duplicate operation. Keys are scoped to account + region with a 24-hour TTL.

  • (defaults to: :unset)

    The partial configuration update.

Returns:

  • Patchd ConfigurationInstance



1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1328

def (
  idempotency_key: :unset,
patch_configuration_request: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Idempotency-Key' => idempotency_key, })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    response = @version.('PATCH', @uri, headers: headers, data: patch_configuration_request.to_json)
    configuration_instance = ConfigurationInstance.new(
        @version,
        response.body,
        id: @solution[:id],
    )
    ConfigurationInstanceMetadata.new(
        @version,
        configuration_instance,
        response.headers,
        response.status_code
    )
end

#to_s ⇒ Object

Provide a user friendly representation



1410
1411
1412
1413
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1410

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

#update(idempotency_key: :unset, update_configuration_request: :unset) ⇒ ConfigurationInstance

Update the ConfigurationInstance

Parameters:

  • (defaults to: :unset)

    Client-generated UUID key to ensure idempotent behavior. Submitting the same key returns the original response without creating a duplicate operation. Keys are scoped to account + region with a 24-hour TTL.

  • (defaults to: :unset)

    The configuration to update

Returns:

  • Updated ConfigurationInstance



1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1358

def update(
  idempotency_key: :unset,
  update_configuration_request: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Idempotency-Key' => idempotency_key, })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    payload = @version.update('PUT', @uri, headers: headers, data: update_configuration_request.to_json)
    ConfigurationInstance.new(
        @version,
        payload,
        id: @solution[:id],
    )
end

#update_with_metadata(idempotency_key: :unset, update_configuration_request: :unset) ⇒ ConfigurationInstance

Update the ConfigurationInstanceMetadata

Parameters:

  • (defaults to: :unset)

    Client-generated UUID key to ensure idempotent behavior. Submitting the same key returns the original response without creating a duplicate operation. Keys are scoped to account + region with a 24-hour TTL.

  • (defaults to: :unset)

    The configuration to update

Returns:

  • Updated ConfigurationInstance



1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
# File 'lib/twilio-ruby/rest/conversations/v2/configuration.rb', line 1382

def (
  idempotency_key: :unset,
update_configuration_request: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'Idempotency-Key' => idempotency_key, })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    response = @version.('PUT', @uri, headers: headers, data: update_configuration_request.to_json)
    configuration_instance = ConfigurationInstance.new(
        @version,
        response.body,
        id: @solution[:id],
    )
    ConfigurationInstanceMetadata.new(
        @version,
        configuration_instance,
        response.headers,
        response.status_code
    )
end