Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::RegulationContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ RegulationContext

Initialize the RegulationContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The unique string that identifies the Regulation resource.



162
163
164
165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 162

def initialize(version, sid)
    super(version)

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

    
end

Instance Method Details

#fetch(include_constraints: :unset) ⇒ RegulationInstance

Fetch the RegulationInstance

Parameters:

  • include_constraints (Boolean) (defaults to: :unset)

    A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields

Returns:



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 175

def fetch(
    include_constraints: :unset
)

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

#inspectObject

Provide a detailed, user friendly representation



206
207
208
209
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 206

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

#to_sObject

Provide a user friendly representation



199
200
201
202
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 199

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Numbers.V2.RegulationContext #{context}>"
end