lib/twilio-ruby/rest/monitor/v1/event.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/monitor/v1/event.rb in twilio-ruby-5.0.0.rc10
- old
+ new
@@ -10,11 +10,10 @@
class V1 < Version
class EventList < ListResource
##
# Initialize the EventList
# @param [Version] version Version that contains the resource
-
# @return [EventList] EventList
def initialize(version)
super(version)
# Path Solution
@@ -40,11 +39,10 @@
# guarantees to never return more than limit. Default is no limit
# @param [Integer] page_size Number of records to fetch per request, when not set will use
# the default value of 50 records. If no page_size is defined
# but a limit is defined, stream() will attempt to read the
# limit with the most efficient page size, i.e. min(limit, 1000)
-
# @return [Array] Array of up to limit results
def list(actor_sid: nil, end_date_before: nil, end_date: nil, end_date_after: nil, event_type: nil, resource_sid: nil, source_ip_address: nil, start_date_before: nil, start_date: nil, start_date_after: nil, limit: nil, page_size: nil)
self.stream(
actor_sid: actor_sid,
end_date_before: end_date_before,
@@ -79,11 +77,10 @@
# guarantees to never return more than limit. Default is no limit
# @param [Integer] page_size Number of records to fetch per request, when not set will use
# the default value of 50 records. If no page_size is defined
# but a limit is defined, stream() will attempt to read the
# limit with the most efficient page size, i.e. min(limit, 1000)
-
# @return [Enumerable] Enumerable that will yield up to limit results
def stream(actor_sid: nil, end_date_before: nil, end_date: nil, end_date_after: nil, event_type: nil, resource_sid: nil, source_ip_address: nil, start_date_before: nil, start_date: nil, start_date_after: nil, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
page = self.page(
@@ -149,11 +146,10 @@
# @param [Time] start_date The start_date
# @param [Time] start_date_after: The start_date
# @param [String] page_token PageToken provided by the API
# @param [Integer] page_number Page Number, this value is simply for client state
# @param [Integer] page_size Number of records to return, defaults to 50
-
# @return [Page] Page of EventInstance
def page(actor_sid: nil, end_date_before: nil, end_date: nil, end_date_after: nil, event_type: nil, resource_sid: nil, source_ip_address: nil, start_date_before: nil, start_date: nil, start_date_after: nil, page_token: nil, page_number: nil, page_size: nil)
params = {
'ActorSid' => actor_sid,
'EndDate<' => Twilio.serialize_iso8601(end_date_before),
@@ -188,11 +184,10 @@
##
# Initialize the EventPage
# @param [Version] version Version that contains the resource
# @param [Response] response Response from the API
# @param [Hash] solution Path solution for the resource
-
# @return [EventPage] EventPage
def initialize(version, response, solution)
super(version, response)
# Path Solution
@@ -200,11 +195,10 @@
end
##
# Build an instance of EventInstance
# @param [Hash] payload Payload response from the API
-
# @return [EventInstance] EventInstance
def get_instance(payload)
return EventInstance.new(
@version,
payload,
@@ -221,11 +215,10 @@
class EventContext < InstanceContext
##
# Initialize the EventContext
# @param [Version] version Version that contains the resource
# @param [String] sid The sid
-
# @return [EventContext] EventContext
def initialize(version, sid)
super(version)
# Path Solution
@@ -248,11 +241,11 @@
)
return EventInstance.new(
@version,
payload,
- sid: @solution['sid'],
+ sid: @solution[:sid],
)
end
##
# Provide a user friendly representation
@@ -266,11 +259,10 @@
##
# Initialize the EventInstance
# @param [Version] version Version that contains the resource
# @param [Hash] payload payload that contains response from Twilio
# @param [String] sid The sid
-
# @return [EventInstance] EventInstance
def initialize(version, payload, sid: nil)
super(version)
# Marshaled Properties
@@ -298,11 +290,10 @@
##
# Generate an instance context for the instance, the context is capable of
# performing various actions. All instance actions are proxied to the context
# @param [Version] version Version that contains the resource
-
# @return [EventContext] EventContext for this EventInstance
def context
unless @instance_context
@instance_context = EventContext.new(
@version,
@@ -362,17 +353,17 @@
##
# Fetch a EventInstance
# @return [EventInstance] Fetched EventInstance
def fetch
- @context.fetch()
+ context.fetch
end
##
# Provide a user friendly representation
def to_s
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
- "<Twilio.Monitor.V1.EventInstance #{context}>"
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
+ "<Twilio.Monitor.V1.EventInstance #{values}>"
end
end
end
end
end
\ No newline at end of file