Class: Twilio::REST::Voice::V2

Inherits:
Twilio::REST::Version show all
Defined in:
lib/twilio-ruby/rest/voice/v2.rb,
lib/twilio-ruby/rest/voice/v2/type.rb,
lib/twilio-ruby/rest/voice/v2/recording.rb,
lib/twilio-ruby/rest/voice/v2/configuration.rb,
lib/twilio-ruby/rest/voice/v2/transcription.rb,
lib/twilio-ruby/rest/voice/v2/configuration/default.rb,
lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb

Defined Under Namespace

Classes: AccountDefaultConfigurationContext, AccountDefaultConfigurationInstance, AccountDefaultConfigurationInstanceMetadata, AccountDefaultConfigurationList, AccountDefaultConfigurationListResponse, AccountDefaultConfigurationPage, AccountDefaultConfigurationPageMetadata, Configuration, ConfigurationContext, ConfigurationInstance, ConfigurationInstanceMetadata, ConfigurationList, ConfigurationListResponse, ConfigurationPage, ConfigurationPageMetadata, RecordingContext, RecordingInstance, RecordingInstanceMetadata, RecordingList, RecordingListResponse, RecordingPage, RecordingPageMetadata, TranscriptionContext, TranscriptionInstance, TranscriptionInstanceMetadata, TranscriptionList, TranscriptionListResponse, TranscriptionPage, TranscriptionPageMetadata, TypeContext, TypeInstance, TypeInstanceMetadata, TypeList, TypeListResponse, TypePage, TypePageMetadata

Instance Attribute Summary

Attributes inherited from Twilio::REST::Version

#domain, #version

Instance Method Summary collapse

Methods inherited from Twilio::REST::Version

#absolute_url, #create, #create_with_metadata, #delete, #delete_with_metadata, #exception, #fetch, #fetch_with_metadata, #page, #patch, #read_limits, #relative_uri, #request, #stream, #stream_with_metadata, #update, #update_with_metadata

Constructor Details

#initialize(domain) ⇒ V2

Initialize the V2 version of Voice



21
22
23
24
25
26
27
28
29
# File 'lib/twilio-ruby/rest/voice/v2.rb', line 21

def initialize(domain)
    super
    @version = 'v2'
    @account_default_configuration = nil
    @configurations = nil
    @recording = nil
    @transcription = nil
    @type = nil
end

Instance Method Details

#account_default_configuration(type = :unset) ⇒ Twilio::REST::Voice::V2::AccountDefaultConfigurationContext, Twilio::REST::Voice::V2::AccountDefaultConfigurationList

Parameters:

  • type (String) (defaults to: :unset)

Returns:



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/twilio-ruby/rest/voice/v2.rb', line 35

def (type=:unset)
    if type.nil?
        raise ArgumentError, 'type cannot be nil'
    end

    if type == :unset
        @account_default_configuration ||= AccountDefaultConfigurationList.new self
    else
        AccountDefaultConfigurationContext.new(self, type)
    end
end

#configurations(type = :unset) ⇒ Twilio::REST::Voice::V2::ConfigurationContext, Twilio::REST::Voice::V2::ConfigurationList

Parameters:

  • type (String) (defaults to: :unset)

Returns:



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/twilio-ruby/rest/voice/v2.rb', line 50

def configurations(type=:unset)
    if type.nil?
        raise ArgumentError, 'type cannot be nil'
    end

    if type == :unset
        @configurations ||= ConfigurationList.new self
    else
        ConfigurationContext.new(self, type)
    end
end

#recording(id_or_unique_name = :unset) ⇒ Twilio::REST::Voice::V2::RecordingContext, Twilio::REST::Voice::V2::RecordingList

Parameters:

  • id_or_unique_name (String) (defaults to: :unset)

    Config id or unique name

Returns:



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/twilio-ruby/rest/voice/v2.rb', line 65

def recording(id_or_unique_name=:unset)
    if id_or_unique_name.nil?
        raise ArgumentError, 'id_or_unique_name cannot be nil'
    end

    if id_or_unique_name == :unset
        @recording ||= RecordingList.new self
    else
        RecordingContext.new(self, id_or_unique_name)
    end
end

#to_sObject

Provide a user friendly representation



135
136
137
# File 'lib/twilio-ruby/rest/voice/v2.rb', line 135

def to_s
    '<Twilio::REST::Voice::V2>';
end

#transcription(id_or_unique_name = :unset) ⇒ Twilio::REST::Voice::V2::TranscriptionContext, Twilio::REST::Voice::V2::TranscriptionList

Parameters:

  • id_or_unique_name (String) (defaults to: :unset)

    Config id or unique name

Returns:



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/twilio-ruby/rest/voice/v2.rb', line 80

def transcription(id_or_unique_name=:unset)
    if id_or_unique_name.nil?
        raise ArgumentError, 'id_or_unique_name cannot be nil'
    end

    if id_or_unique_name == :unset
        @transcription ||= TranscriptionList.new self
    else
        TranscriptionContext.new(self, id_or_unique_name)
    end
end

#type(type = :unset, id_or_unique_name = :unset) ⇒ Twilio::REST::Voice::V2::TypeContext, Twilio::REST::Voice::V2::TypeList

Parameters:

  • type (String) (defaults to: :unset)
  • id_or_unique_name (String) (defaults to: :unset)

    Config id or unique name

Returns:



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/twilio-ruby/rest/voice/v2.rb', line 96

def type(type=:unset, id_or_unique_name=:unset)
    if type.nil?
        raise ArgumentError, 'type cannot be nil'
    end
    if id_or_unique_name.nil?
        raise ArgumentError, 'id_or_unique_name cannot be nil'
    end

    if type == :unset && id_or_unique_name == :unset
        @type ||= TypeList.new self
    elsif type != :unset && id_or_unique_name == :unset
        TypeList.new(self, type: type)
    else
        TypeContext.new(self, type, id_or_unique_name)
    end
end