Class: Twilio::REST::Intelligence::V2::TranscriptContext::MediaContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ MediaContext

Initialize the MediaContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The unique SID identifier of the Transcript.



51
52
53
54
55
56
57
58
59
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb', line 51

def initialize(version, sid)
    super(version)

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

    
end

Instance Method Details

#fetch(redacted: :unset) ⇒ MediaInstance

Fetch the MediaInstance

Parameters:

  • redacted (Boolean) (defaults to: :unset)

    Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is ‘true` to access redacted media.

Returns:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb', line 64

def fetch(
    redacted: :unset
)

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

#inspectObject

Provide a detailed, user friendly representation



95
96
97
98
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb', line 95

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

#to_sObject

Provide a user friendly representation



88
89
90
91
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb', line 88

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