lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb in twilio-ruby-5.39.0
- old
+ new
@@ -26,22 +26,15 @@
@solution = {bundle_sid: bundle_sid}
@uri = "/RegulatoryCompliance/Bundles/#{@solution[:bundle_sid]}/Evaluations"
end
##
- # Retrieve a single page of EvaluationInstance records from the API.
- # Request is executed immediately.
- # @return [EvaluationInstance] Newly created EvaluationInstance
+ # Create the EvaluationInstance
+ # @return [EvaluationInstance] Created EvaluationInstance
def create
- data = Twilio::Values.of({})
+ payload = @version.create('POST', @uri)
- payload = @version.create(
- 'POST',
- @uri,
- data: data
- )
-
EvaluationInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
end
##
# Lists EvaluationInstance records from the API as a list.
@@ -102,15 +95,13 @@
params = Twilio::Values.of({
'PageToken' => page_token,
'Page' => page_number,
'PageSize' => page_size,
})
- response = @version.page(
- 'GET',
- @uri,
- params
- )
+
+ response = @version.page('GET', @uri, params)
+
EvaluationPage.new(@version, response, @solution)
end
##
# Retrieve a single page of EvaluationInstance records from the API.
@@ -176,21 +167,15 @@
@solution = {bundle_sid: bundle_sid, sid: sid, }
@uri = "/RegulatoryCompliance/Bundles/#{@solution[:bundle_sid]}/Evaluations/#{@solution[:sid]}"
end
##
- # Fetch a EvaluationInstance
+ # Fetch the EvaluationInstance
# @return [EvaluationInstance] Fetched EvaluationInstance
def fetch
- params = Twilio::Values.of({})
+ payload = @version.fetch('GET', @uri)
- payload = @version.fetch(
- 'GET',
- @uri,
- params,
- )
-
EvaluationInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], sid: @solution[:sid], )
end
##
# Provide a user friendly representation
@@ -294,10 +279,10 @@
def url
@properties['url']
end
##
- # Fetch a EvaluationInstance
+ # Fetch the EvaluationInstance
# @return [EvaluationInstance] Fetched EvaluationInstance
def fetch
context.fetch
end
\ No newline at end of file