class Plivo::Resources::EndpointInterface

@!method get @!method create @!method list

Public Class Methods

new(client, resource_list_json = nil) click to toggle source
Calls superclass method Plivo::Base::ResourceInterface::new
# File lib/plivo/resources/endpoints.rb, line 70
def initialize(client, resource_list_json = nil)
  @_name = 'Endpoint'
  @_resource_type = Endpoint
  @_identifier_string = 'endpoint_id'
  super
  @_is_voice_request = true
end

Public Instance Methods

create(username, password, alias_, app_id = nil) click to toggle source

@param [String] username @param [String] password @param [String] alias_ @param [String] app_id

# File lib/plivo/resources/endpoints.rb, line 88
def create(username, password, alias_, app_id = nil)
  valid_param?(:username, username, [String, Symbol], true)
  valid_param?(:password, password, [String, Symbol], true)
  valid_param?(:alias, alias_, [String, Symbol], true)

  params = {
    username: username,
    password: password,
    alias: alias_
  }

  params[:app_id] = app_id unless app_id.nil?

  perform_create(params)
end
delete(endpoint_id) click to toggle source

@param [String] endpoint_id

# File lib/plivo/resources/endpoints.rb, line 125
def delete(endpoint_id)
  valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true)
  Endpoint.new(@_client,
               resource_id: endpoint_id).delete
end
each() { |endpoint| ... } click to toggle source
# File lib/plivo/resources/endpoints.rb, line 108
def each
  endpoint_list = list
  endpoint_list[:objects].each { |endpoint| yield endpoint }
end
get(endpoint_id) click to toggle source

@param [String] endpoint_id

# File lib/plivo/resources/endpoints.rb, line 79
def get(endpoint_id)
  valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true)
  perform_get(endpoint_id)
end
list() click to toggle source
# File lib/plivo/resources/endpoints.rb, line 104
def list
  perform_list
end
update(endpoint_id, options = nil) click to toggle source

@param [String] endpoint_id @param [Hash] options @option options [String] :password The password for your endpoint username. @option options [String] :alias Alias for this endpoint @option options [String] :app_id The app_id of the application that is to be attached to this endpoint. If app_id is not specified, then the endpoint does not point to any application.

# File lib/plivo/resources/endpoints.rb, line 118
def update(endpoint_id, options = nil)
  valid_param?(:endpoint_id, endpoint_id, [String, Symbol], true)
  Endpoint.new(@_client,
               resource_id: endpoint_id).update(options)
end