Updating

Channels are updated from the context of a VoiceLayerChannel object.

Channels can be updated using any of the VoiceLayerChannel.PROPERTY constants.

The authenticated user must have the appropriate channel permissions to update a channel or the request will fail.

Update a Single Property

To update a single property on a channel:

VoiceLayerChannel updatedChannel = channel.update(VoiceLayerChannel.PROPERTY_NAME, "new_channel_name");

or

channel.update(VoiceLayerChannel.PROPERTY_NAME, "new_channel_name", new VoiceLayerUpdateCallback<VoiceLayerChannel>() {
    @Override
    public void onUpdateComplete(VoiceLayerChannel channel, VoiceLayerException exception) {

    }
});

Update Multiple Properties

To update multiple properties on a channel first create a map of property keys to their new values:

Map<String, Object> properties = new HashMap<>();
properties.put(VoiceLayerChannel.PROPERTY_NAME, "new_channel_name");
properties.put(VoiceLayerChannel.PROPERTY_PUBLIC, true);

then perform the channel update:

VoiceLayerChannel updatedChannel = channel.update(properties);

or

channel.update(properties, new VoiceLayerUpdateCallback<VoiceLayerChannel>() {
    @Override
    public void onUpdateComplete(VoiceLayerChannel channel, VoiceLayerException exception) {

    }
});