Class: Twilio::REST::Marketplace::V1::ModuleDataManagementInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the ModuleDataManagementInstance

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 ModuleDataManagement resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 167

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'url' => payload['url'],
        'sid' => payload['sid'],
        'description' => payload['description'],
        'support' => payload['support'],
        'policies' => payload['policies'],
        'module_info' => payload['module_info'],
        'documentation' => payload['documentation'],
        'configuration' => payload['configuration'],
        'pricing' => payload['pricing'],
    }

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

Instance Method Details

#configurationHash

Returns A JSON object for providing listing specific configuration. Contains button setup, notification url, among others.

Returns:

  • (Hash)

    A JSON object for providing listing specific configuration. Contains button setup, notification url, among others.



243
244
245
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 243

def configuration
    @properties['configuration']
end

#contextModuleDataManagementContext

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

Returns:



192
193
194
195
196
197
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 192

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

#descriptionHash

Returns A JSON object describing the module and is displayed under the Description tab of the Module detail page. You can define the main body of the description, highlight key features or aspects of the module and if applicable, provide code samples for developers.

Returns:

  • (Hash)

    A JSON object describing the module and is displayed under the Description tab of the Module detail page. You can define the main body of the description, highlight key features or aspects of the module and if applicable, provide code samples for developers



213
214
215
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 213

def description
    @properties['description']
end

#documentationHash

Returns A JSON object for providing comprehensive information, instructions, and resources related to the module.

Returns:

  • (Hash)

    A JSON object for providing comprehensive information, instructions, and resources related to the module



237
238
239
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 237

def documentation
    @properties['documentation']
end

#fetchModuleDataManagementInstance

Fetch the ModuleDataManagementInstance

Returns:



256
257
258
259
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 256

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



301
302
303
304
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 301

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

#module_infoHash

Returns A JSON object containing essential attributes that define a module. This information is presented on the Module detail page in the Twilio Marketplace Catalog. You can pass the following attributes in the JSON object.

Returns:

  • (Hash)

    A JSON object containing essential attributes that define a module. This information is presented on the Module detail page in the Twilio Marketplace Catalog. You can pass the following attributes in the JSON object



231
232
233
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 231

def module_info
    @properties['module_info']
end

#policiesHash

Returns A JSON object describing the module’s privacy and legal policies and is displayed under the Policies tab of the Module detail page. The maximum file size for Policies is 5MB.

Returns:

  • (Hash)

    A JSON object describing the module’s privacy and legal policies and is displayed under the Policies tab of the Module detail page. The maximum file size for Policies is 5MB



225
226
227
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 225

def policies
    @properties['policies']
end

#pricingHash

Returns A JSON object for providing Listing specific pricing information.

Returns:

  • (Hash)

    A JSON object for providing Listing specific pricing information.



249
250
251
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 249

def pricing
    @properties['pricing']
end

#sidString

Returns ModuleSid that identifies this Listing.

Returns:

  • (String)

    ModuleSid that identifies this Listing.



207
208
209
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 207

def sid
    @properties['sid']
end

#supportHash

Returns A JSON object containing information on how customers can obtain support for the module. Use this parameter to provide details such as contact information and support description.

Returns:

  • (Hash)

    A JSON object containing information on how customers can obtain support for the module. Use this parameter to provide details such as contact information and support description.



219
220
221
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 219

def support
    @properties['support']
end

#to_sObject

Provide a user friendly representation



294
295
296
297
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 294

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

#update(module_info: :unset, description: :unset, documentation: :unset, policies: :unset, support: :unset, configuration: :unset, pricing: :unset) ⇒ ModuleDataManagementInstance

Update the ModuleDataManagementInstance

Parameters:

  • module_info (String) (defaults to: :unset)

    A JSON object containing essential attributes that define a Listing.

  • description (String) (defaults to: :unset)

    A JSON object describing the Listing. You can define the main body of the description, highlight key features or aspects of the Listing, and provide code samples for developers if applicable.

  • documentation (String) (defaults to: :unset)

    A JSON object for providing comprehensive information, instructions, and resources related to the Listing.

  • policies (String) (defaults to: :unset)

    A JSON object describing the Listing’s privacy and legal policies. The maximum file size for Policies is 5MB.

  • support (String) (defaults to: :unset)

    A JSON object containing information on how Marketplace users can obtain support for the Listing. Use this parameter to provide details such as contact information and support description.

  • configuration (String) (defaults to: :unset)

    A JSON object for providing Listing-specific configuration. Contains button setup, notification URL, and more.

  • pricing (String) (defaults to: :unset)

    A JSON object for providing Listing’s purchase options.

Returns:



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 271

def update(
    module_info: :unset, 
    description: :unset, 
    documentation: :unset, 
    policies: :unset, 
    support: :unset, 
    configuration: :unset, 
    pricing: :unset
)

    context.update(
        module_info: module_info, 
        description: description, 
        documentation: documentation, 
        policies: policies, 
        support: support, 
        configuration: configuration, 
        pricing: pricing, 
    )
end

#urlString

Returns URL to query the subresource.

Returns:

  • (String)

    URL to query the subresource.



201
202
203
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 201

def url
    @properties['url']
end