Class: Twilio::REST::Marketplace::V1::ModuleDataManagementContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ ModuleDataManagementContext

Initialize the ModuleDataManagementContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    SID that uniquely identifies the Listing.



50
51
52
53
54
55
56
57
58
59
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 50

def initialize(version, sid)
    super(version)
    

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

    
end

Instance Method Details

#fetchModuleDataManagementInstance

Fetch the ModuleDataManagementInstance

Returns:



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 63

def fetch

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

#fetch_with_metadataModuleDataManagementInstance

Fetch the ModuleDataManagementInstanceMetadata

Returns:



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

def 

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

#inspectObject

Provide a detailed, user friendly representation



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

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

#to_sObject

Provide a user friendly representation



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

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Marketplace.V1.ModuleDataManagementContext #{context}>"
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:



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 114

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

    data = Twilio::Values.of({
        'ModuleInfo' => module_info,
        'Description' => description,
        'Documentation' => documentation,
        'Policies' => policies,
        'Support' => support,
        'Configuration' => configuration,
        'Pricing' => pricing,
    })

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

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

Update the ModuleDataManagementInstanceMetadata

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:



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb', line 158

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

    data = Twilio::Values.of({
        'ModuleInfo' => module_info,
        'Description' => description,
        'Documentation' => documentation,
        'Policies' => policies,
        'Support' => support,
        'Configuration' => configuration,
        'Pricing' => pricing,
    })

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