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



48
49
50
51
52
53
54
55
56
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 48

def initialize(version)
    super(version)

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

    
end

Instance Method Details

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

Fetch the VerificationAttemptsSummaryInstance

Parameters:

  • verify_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 ISO 8601 formatted datetime string: yyyy-MM-dd’T’HH:mm:ss’Z.

  • 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 ISO 8601 formatted datetime string: yyyy-MM-dd’T’HH:mm:ss’Z.

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

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

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

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

  • 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:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 66

def fetch(
    verify_service_sid: :unset, 
    date_created_after: :unset, 
    date_created_before: :unset, 
    country: :unset, 
    channel: :unset, 
    destination_prefix: :unset
)

    params = Twilio::Values.of({
        'VerifyServiceSid' => verify_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,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, params: params, headers: headers)
    VerificationAttemptsSummaryInstance.new(
        @version,
        payload,
    )
end

#inspectObject

Provide a detailed, user friendly representation



106
107
108
109
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 106

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

#to_sObject

Provide a user friendly representation



99
100
101
102
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 99

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