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



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

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.

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



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
95
96
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 68

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

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

Fetch the VerificationAttemptsSummaryInstanceMetadata

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.

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



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 107

def (
  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', })
    
    
    
    
    
    response = @version.('GET', @uri, params: params, headers: headers)
    verification_attempts_summary_instance = VerificationAttemptsSummaryInstance.new(
        @version,
        response.body,
    )
    VerificationAttemptsSummaryInstanceMetadata.new(
        @version,
        verification_attempts_summary_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



153
154
155
156
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 153

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

#to_sObject

Provide a user friendly representation



146
147
148
149
# File 'lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb', line 146

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