Class: Twilio::REST::Verify::V2::VerificationAttemptsSummaryContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ VerificationAttemptsSummaryContext

Initialize the VerificationAttemptsSummaryContext

Parameters:

  • version (Version)

    Version that contains the resource



66
67
68
69
70
71
72
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 66

def initialize(version)
  super(version)

  # Path Solution
  @solution = {}
  @uri = "/Attempts/Summary"
end

Instance Method Details

#fetch(service_sid: :unset, date_created_after: :unset, date_created_before: :unset, country: :unset, channel: :unset, destination_prefix: :unset) ⇒ VerificationAttemptsSummaryInstance

Fetch the VerificationAttemptsSummaryInstance

Parameters:

  • service_sid (String) (defaults to: :unset)

    Filter used to consider only Verification Attempts of the given verify service on the summary aggregation.

  • date_created_after (Time) (defaults to: :unset)

    Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in RFC 2822 format.

  • date_created_before (Time) (defaults to: :unset)

    Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in RFC 2822 format.

  • country (String) (defaults to: :unset)

    Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation.

  • channel (verification_attempts_summary.Channels) (defaults to: :unset)

    Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are ‘SMS` and `CALL`

  • destination_prefix (String) (defaults to: :unset)

    Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format.

Returns:



93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 93

def fetch(service_sid: :unset, date_created_after: :unset, date_created_before: :unset, country: :unset, channel: :unset, destination_prefix: :unset)
  params = Twilio::Values.of({
      'ServiceSid' => service_sid,
      'DateCreatedAfter' => Twilio.serialize_iso8601_datetime(date_created_after),
      'DateCreatedBefore' => Twilio.serialize_iso8601_datetime(date_created_before),
      'Country' => country,
      'Channel' => channel,
      'DestinationPrefix' => destination_prefix,
  })

  payload = @version.fetch('GET', @uri, params: params)

  VerificationAttemptsSummaryInstance.new(@version, payload, )
end

#inspectObject

Provide a detailed, user friendly representation



117
118
119
120
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 117

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

#to_sObject

Provide a user friendly representation



110
111
112
113
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 110

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