Class: Twilio::REST::Content::V1::ContentContext::ApprovalFetchContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ ApprovalFetchContext

Initialize the ApprovalFetchContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch.



52
53
54
55
56
57
58
59
60
61
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 52

def initialize(version, sid)
    super(version)
    

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

    
end

Instance Method Details

#fetchApprovalFetchInstance

Fetch the ApprovalFetchInstance

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 65

def fetch

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

#fetch_with_metadataApprovalFetchInstance

Fetch the ApprovalFetchInstanceMetadata

Returns:



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 84

def 

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

#inspectObject

Provide a detailed, user friendly representation



116
117
118
119
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 116

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

#to_sObject

Provide a user friendly representation



109
110
111
112
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 109

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