Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::SupportingDocumentTypeInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb

Instance Method Summary collapse

Constructor Details

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

Initialize the SupportingDocumentTypeInstance

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 identifies the Supporting Document Type resource.


190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 190

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

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'friendly_name' => payload['friendly_name'],
      'machine_name' => payload['machine_name'],
      'fields' => payload['fields'],
      'url' => payload['url'],
  }

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

Instance Method Details

#contextSupportingDocumentTypeContext

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

Returns:


211
212
213
214
215
216
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 211

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

#fetchSupportingDocumentTypeInstance

Fetch the SupportingDocumentTypeInstance

Returns:


251
252
253
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 251

def fetch
  context.fetch
end

#fieldsArray[Hash]

Returns The required information for creating a Supporting Document.

Returns:

  • (Array[Hash])

    The required information for creating a Supporting Document


238
239
240
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 238

def fields
  @properties['fields']
end

#friendly_nameString

Returns A human-readable description of the Supporting Document Type resource.

Returns:

  • (String)

    A human-readable description of the Supporting Document Type resource


226
227
228
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 226

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation


264
265
266
267
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 264

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

#machine_nameString

Returns The machine-readable description of the Supporting Document Type resource.

Returns:

  • (String)

    The machine-readable description of the Supporting Document Type resource


232
233
234
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 232

def machine_name
  @properties['machine_name']
end

#sidString

Returns The unique string that identifies the Supporting Document Type resource.

Returns:

  • (String)

    The unique string that identifies the Supporting Document Type resource


220
221
222
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 220

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


257
258
259
260
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 257

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

#urlString

Returns The absolute URL of the Supporting Document Type resource.

Returns:

  • (String)

    The absolute URL of the Supporting Document Type resource


244
245
246
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb', line 244

def url
  @properties['url']
end