Class: Twilio::REST::Content::V1::ContentContext::ApprovalFetchInstance

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ApprovalFetchInstance

Initialize the ApprovalFetchInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    The unique string that that we created to identify the Content resource.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 119

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'whatsapp' => payload['whatsapp'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'sid' => sid, }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the Content resource.

Returns:

  • (String)

    The SID of the Account that created the Content resource



154
155
156
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 154

def 
  @properties['account_sid']
end

#contextApprovalFetchContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



139
140
141
142
143
144
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 139

def context
  unless @instance_context
    @instance_context = ApprovalFetchContext.new(@version, @params['sid'], )
  end
  @instance_context
end

#fetchApprovalFetchInstance

Fetch the ApprovalFetchInstance

Returns:



173
174
175
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 173

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



186
187
188
189
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 186

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Content.V1.ApprovalFetchInstance #{values}>"
end

#sidString

Returns The unique string that identifies the Content resource.

Returns:

  • (String)

    The unique string that identifies the Content resource



148
149
150
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 148

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



179
180
181
182
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 179

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Content.V1.ApprovalFetchInstance #{values}>"
end

#urlString

Returns The URL of the resource, relative to ‘content.twilio.com`.

Returns:



166
167
168
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 166

def url
  @properties['url']
end

#whatsappHash

Returns Contains the whatsapp approval information for the Content resource.

Returns:

  • (Hash)

    Contains the whatsapp approval information for the Content resource



160
161
162
# File 'lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb', line 160

def whatsapp
  @properties['whatsapp']
end