Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::EndUserTypeContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ EndUserTypeContext

Initialize the EndUserTypeContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The unique string that identifies the End-User Type resource.



161
162
163
164
165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 161

def initialize(version, sid)
    super(version)
    

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

    
end

Instance Method Details

#fetchEndUserTypeInstance

Fetch the EndUserTypeInstance

Returns:



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 174

def fetch

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

#fetch_with_metadataEndUserTypeInstance

Fetch the EndUserTypeInstanceMetadata

Returns:



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 193

def 

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

#inspectObject

Provide a detailed, user friendly representation



225
226
227
228
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 225

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

#to_sObject

Provide a user friendly representation



218
219
220
221
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 218

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