Class: Retell::SDK::Unofficial::PhoneNumber

Inherits:
Base
  • Object
show all
Defined in:
lib/retell/sdk/unofficial/phone_number.rb

Instance Attribute Summary

Attributes inherited from Base

#changed_attributes, #client

Instance Method Summary collapse

Methods inherited from Base

#[], #[]=, #each, each_attribute, #fetch, inherited, #initialize, #keys, #to_h, #values, writeable_attributes

Constructor Details

This class inherits a constructor from Retell::SDK::Unofficial::Base

Instance Method Details

#deleteObject



56
57
58
# File 'lib/retell/sdk/unofficial/phone_number.rb', line 56

def delete
  @client.phone_number.delete(self)
end

#inbound_agentObject



22
23
24
# File 'lib/retell/sdk/unofficial/phone_number.rb', line 22

def inbound_agent
  inbound_agent_id
end

#inbound_agent=(value) ⇒ Object



26
27
28
# File 'lib/retell/sdk/unofficial/phone_number.rb', line 26

def inbound_agent=(value)
  self[:inbound_agent_id] = value
end

#outbound_agentObject



30
31
32
# File 'lib/retell/sdk/unofficial/phone_number.rb', line 30

def outbound_agent
  outbound_agent_id
end

#outbound_agent=(value) ⇒ Object



34
35
36
# File 'lib/retell/sdk/unofficial/phone_number.rb', line 34

def outbound_agent=(value)
  self[:outbound_agent_id] = value
end

#retrieveObject



38
39
40
# File 'lib/retell/sdk/unofficial/phone_number.rb', line 38

def retrieve
  @client.phone_number.retrieve(self)
end

#update(**params) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/retell/sdk/unofficial/phone_number.rb', line 42

def update(**params)
  update_params = @changed_attributes.merge(params)

  if update_params.any?
    updated_phone_number = @client.phone_number.update(self, **update_params)
    self.class.attributes.each do |attr|
      instance_variable_set("@#{attr}", updated_phone_number.send(attr))
    end
    @changed_attributes.clear
  end

  self
end