Class: Twilio::REST::Microvisor::V1::AppContext::AppManifestInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, app_sid: nil) ⇒ AppManifestInstance

Initialize the AppManifestInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this AppManifest resource.

  • sid (String)

    The SID of the Call resource to fetch.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb', line 128

def initialize(version, payload , app_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'app_sid' => payload['app_sid'],
        'hash' => payload['hash'],
        'encoded_bytes' => payload['encoded_bytes'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'app_sid' => app_sid  || @properties['app_sid']  , }
end

Instance Method Details

#app_sidString

Returns A 34-character string that uniquely identifies this App.

Returns:

  • (String)

    A 34-character string that uniquely identifies this App.



157
158
159
# File 'lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb', line 157

def app_sid
    @properties['app_sid']
end

#contextAppManifestContext

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

Returns:



148
149
150
151
152
153
# File 'lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb', line 148

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

#encoded_bytesString

Returns The base-64 encoded manifest.

Returns:

  • (String)

    The base-64 encoded manifest



169
170
171
# File 'lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb', line 169

def encoded_bytes
    @properties['encoded_bytes']
end

#fetchAppManifestInstance

Fetch the AppManifestInstance

Returns:



182
183
184
185
# File 'lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb', line 182

def fetch

    context.fetch
end

#hashString

Returns App manifest hash represented as ‘hash_algorithm:hash_value`.

Returns:

  • (String)

    App manifest hash represented as ‘hash_algorithm:hash_value`.



163
164
165
# File 'lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb', line 163

def hash
    @properties['hash']
end

#inspectObject

Provide a detailed, user friendly representation



196
197
198
199
# File 'lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb', line 196

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

#to_sObject

Provide a user friendly representation



189
190
191
192
# File 'lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb', line 189

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

#urlString

Returns The absolute URL of this Manifest.

Returns:

  • (String)

    The absolute URL of this Manifest.



175
176
177
# File 'lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb', line 175

def url
    @properties['url']
end