Class: Twilio::REST::Intelligence::V2::OperatorTypeContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/operator_type.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ OperatorTypeContext

Initialize the OperatorTypeContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    Either a 34 character string that uniquely identifies this Operator Type or the unique name that references an Operator Type.



136
137
138
139
140
141
142
143
144
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 136

def initialize(version, sid)
    super(version)

    # Path Solution
    @solution = { sid: sid,  }
    @uri = "/OperatorTypes/#{@solution[:sid]}"

    
end

Instance Method Details

#fetchOperatorTypeInstance

Fetch the OperatorTypeInstance

Returns:



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 148

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



174
175
176
177
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 174

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

#to_sObject

Provide a user friendly representation



167
168
169
170
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 167

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