twilio 3.76.0 → 3.76.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,8 +5,6 @@
5
5
  [![Tests](https://github.com/twilio/twilio-node/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/twilio/twilio-node/actions/workflows/test-and-deploy.yml)
6
6
  [![Learn with TwilioQuest](https://img.shields.io/static/v1?label=TwilioQuest&message=Learn%20to%20contribute%21&color=F22F46&labelColor=1f243c&style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAASFBMVEUAAAAZGRkcHBwjIyMoKCgAAABgYGBoaGiAgICMjIyzs7PJycnMzMzNzc3UoBfd3d3m5ubqrhfrMEDu7u739/f4vSb/3AD///9tbdyEAAAABXRSTlMAAAAAAMJrBrEAAAKoSURBVHgB7ZrRcuI6EESdyxXGYoNFvMD//+l2bSszRgyUYpFAsXOeiJGmj4NkuWx1Qeh+Ekl9DgEXOBwOx+Px5xyQhDykfgq4wG63MxxaR4ddIkg6Ul3g84vCIcjPBA5gmUMeXESrlukuoK33+33uID8TWeLAdOWsKpJYzwVMB7bOzYSGOciyUlXSn0/ABXTosJ1M1SbypZ4O4MbZuIDMU02PMbauhhHMHXbmebmALIiEbbbbbUrpF1gwE9kFfRNAJaP+FQEXCCTGyJ4ngDrjOFo3jEL5JdqjF/pueR4cCeCGgAtwmuRS6gDwaRiGvu+DMFwSBLTE3+jF8JyuV1okPZ+AC4hDFhCHyHQjdjPHUKFDlHSJkHQXMB3KpSwXNGJPcwwTdZiXlRN0gSp0zpWxNtM0beYE0nRH6QIbO7rawwXaBYz0j78gxjokDuv12gVeUuBD0MDi0OQCLvDaAho4juP1Q/jkAncXqIcCfd+7gAu4QLMACCLxpRsSuQh0igu0C9Svhi7weAGZg50L3IE3cai4IfkNZAC8dfdhsUD3CgKBVC9JE5ABAFzg4QL/taYPAAWrHdYcgfLaIgAXWJ7OV38n1LEF8tt2TH29E+QAoDoO5Ve/LtCQDmKM9kPbvCEBApK+IXzbcSJ0cIGF6e8gpcRhUDogWZ8JnaWjPXc/fNnBBUKRngiHgTUSivSzDRDgHZQOLvBQgf8rRt+VdBUUhwkU6VpJ+xcOwQUqZr+mR0kvBUgv6cB4+37hQAkXqE8PwGisGhJtN4xAHMzrsgvI7rccXqSvKh6jltGlrOHA3Xk1At3LC4QiPdX9/0ndHpGVvTjR4bZA1ypAKgVcwE5vx74ulwIugDt8e/X7JgfkucBMIAr26ndnB4UCLnDOqvteQsHlgX9N4A+c4cW3DXSPbwAAAABJRU5ErkJggg==)](https://twil.io/learn-open-source)
7
7
 
8
- **The default branch name for this repository has been changed to `main` as of 07/27/2020.**
9
-
10
8
  ## Documentation
11
9
 
12
10
  The documentation for the Twilio API can be found [here][apidocs].
@@ -12,6 +12,7 @@ import { FormListInstance } from './verify/v2/form';
12
12
  import { ServiceListInstance } from './verify/v2/service';
13
13
  import { TemplateListInstance } from './verify/v2/template';
14
14
  import { VerificationAttemptListInstance } from './verify/v2/verificationAttempt';
15
+ import { VerificationAttemptsSummaryListInstance } from './verify/v2/verificationAttemptsSummary';
15
16
 
16
17
 
17
18
  declare class Verify extends Domain {
@@ -27,6 +28,7 @@ declare class Verify extends Domain {
27
28
  readonly templates: TemplateListInstance;
28
29
  readonly v2: V2;
29
30
  readonly verificationAttempts: VerificationAttemptListInstance;
31
+ readonly verificationAttemptsSummary: VerificationAttemptsSummaryListInstance;
30
32
  }
31
33
 
32
34
  export = Verify;
@@ -25,6 +25,8 @@ var V2 = require('./verify/V2'); /* jshint ignore:line */
25
25
  * @property {Twilio.Verify.V2.ServiceList} services - services resource
26
26
  * @property {Twilio.Verify.V2.VerificationAttemptList} verificationAttempts -
27
27
  * verificationAttempts resource
28
+ * @property {Twilio.Verify.V2.VerificationAttemptsSummaryList} verificationAttemptsSummary -
29
+ * verificationAttemptsSummary resource
28
30
  * @property {Twilio.Verify.V2.TemplateList} templates - templates resource
29
31
  *
30
32
  * @param {Twilio} twilio - The twilio client
@@ -69,6 +71,13 @@ Object.defineProperty(Verify.prototype,
69
71
  }
70
72
  });
71
73
 
74
+ Object.defineProperty(Verify.prototype,
75
+ 'verificationAttemptsSummary', {
76
+ get: function() {
77
+ return this.v2.verificationAttemptsSummary;
78
+ }
79
+ });
80
+
72
81
  Object.defineProperty(Verify.prototype,
73
82
  'templates', {
74
83
  get: function() {
@@ -384,7 +384,6 @@ interface CallPayload extends CallResource, Page.TwilioResponsePayload {
384
384
 
385
385
  interface CallResource {
386
386
  account_sid: string;
387
- annotation: string;
388
387
  answered_by: string;
389
388
  api_version: string;
390
389
  caller_name: string;
@@ -479,7 +478,6 @@ declare class CallInstance extends SerializableClass {
479
478
 
480
479
  private _proxy: CallContext;
481
480
  accountSid: string;
482
- annotation: string;
483
481
  answeredBy: string;
484
482
  apiVersion: string;
485
483
  callerName: string;
@@ -653,7 +653,6 @@ CallPage.prototype[util.inspect.custom] = function inspect(depth, options) {
653
653
  * A string describing the direction of the call. `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `Dial` verb.
654
654
  * @property {string} answeredBy -
655
655
  * Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise.
656
- * @property {string} annotation - The annotation provided for the call
657
656
  * @property {string} apiVersion - The API Version used to create the call
658
657
  * @property {string} forwardedFrom -
659
658
  * The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty.
@@ -698,7 +697,6 @@ CallInstance = function CallInstance(version, payload, accountSid, sid) {
698
697
  this.priceUnit = payload.price_unit; // jshint ignore:line
699
698
  this.direction = payload.direction; // jshint ignore:line
700
699
  this.answeredBy = payload.answered_by; // jshint ignore:line
701
- this.annotation = payload.annotation; // jshint ignore:line
702
700
  this.apiVersion = payload.api_version; // jshint ignore:line
703
701
  this.forwardedFrom = payload.forwarded_from; // jshint ignore:line
704
702
  this.groupSid = payload.group_sid; // jshint ignore:line
@@ -15,6 +15,8 @@ import { TemplateList } from './v2/template';
15
15
  import { TemplateListInstance } from './v2/template';
16
16
  import { VerificationAttemptList } from './v2/verificationAttempt';
17
17
  import { VerificationAttemptListInstance } from './v2/verificationAttempt';
18
+ import { VerificationAttemptsSummaryList } from './v2/verificationAttemptsSummary';
19
+ import { VerificationAttemptsSummaryListInstance } from './v2/verificationAttemptsSummary';
18
20
 
19
21
 
20
22
  declare class V2 extends Version {
@@ -29,6 +31,7 @@ declare class V2 extends Version {
29
31
  readonly services: ServiceListInstance;
30
32
  readonly templates: TemplateListInstance;
31
33
  readonly verificationAttempts: VerificationAttemptListInstance;
34
+ readonly verificationAttemptsSummary: VerificationAttemptsSummaryListInstance;
32
35
  }
33
36
 
34
37
  export = V2;
@@ -15,6 +15,8 @@ var ServiceList = require('./v2/service').ServiceList;
15
15
  var TemplateList = require('./v2/template').TemplateList;
16
16
  var VerificationAttemptList = require(
17
17
  './v2/verificationAttempt').VerificationAttemptList;
18
+ var VerificationAttemptsSummaryList = require(
19
+ './v2/verificationAttemptsSummary').VerificationAttemptsSummaryList;
18
20
  var Version = require('../../base/Version'); /* jshint ignore:line */
19
21
 
20
22
 
@@ -28,6 +30,8 @@ var Version = require('../../base/Version'); /* jshint ignore:line */
28
30
  * @property {Twilio.Verify.V2.ServiceList} services - services resource
29
31
  * @property {Twilio.Verify.V2.VerificationAttemptList} verificationAttempts -
30
32
  * verificationAttempts resource
33
+ * @property {Twilio.Verify.V2.VerificationAttemptsSummaryList} verificationAttemptsSummary -
34
+ * verificationAttemptsSummary resource
31
35
  * @property {Twilio.Verify.V2.TemplateList} templates - templates resource
32
36
  *
33
37
  * @param {Twilio.Verify} domain - The twilio domain
@@ -40,6 +44,7 @@ function V2(domain) {
40
44
  this._forms = undefined;
41
45
  this._services = undefined;
42
46
  this._verificationAttempts = undefined;
47
+ this._verificationAttemptsSummary = undefined;
43
48
  this._templates = undefined;
44
49
  }
45
50
 
@@ -70,6 +75,14 @@ Object.defineProperty(V2.prototype,
70
75
  }
71
76
  });
72
77
 
78
+ Object.defineProperty(V2.prototype,
79
+ 'verificationAttemptsSummary', {
80
+ get: function() {
81
+ this._verificationAttemptsSummary = this._verificationAttemptsSummary || new VerificationAttemptsSummaryList(this);
82
+ return this._verificationAttemptsSummary;
83
+ }
84
+ });
85
+
73
86
  Object.defineProperty(V2.prototype,
74
87
  'templates', {
75
88
  get: function() {
@@ -0,0 +1,156 @@
1
+ /**
2
+ * This code was generated by
3
+ * \ / _ _ _| _ _
4
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ * / /
6
+ */
7
+
8
+ import Page = require('../../../base/Page');
9
+ import Response = require('../../../http/response');
10
+ import V2 = require('../V2');
11
+ import { SerializableClass } from '../../../interfaces';
12
+
13
+ type VerificationAttemptsSummaryChannels = 'sms'|'call'|'email'|'whatsapp';
14
+
15
+ /**
16
+ * Initialize the VerificationAttemptsSummaryList
17
+ *
18
+ * @param version - Version of the resource
19
+ */
20
+ declare function VerificationAttemptsSummaryList(version: V2): VerificationAttemptsSummaryListInstance;
21
+
22
+ /**
23
+ * Options to pass to fetch
24
+ *
25
+ * @property channel - Filter verification attempts considered on the summary by communication channel.
26
+ * @property country - Filter verification attempts considered on the summary by destination country.
27
+ * @property dateCreatedAfter - Consider verification attempts create after this date on the summary.
28
+ * @property dateCreatedBefore - Consider verification attempts created before this date on the summary.
29
+ * @property destinationPrefix - Filters the attempts considered on the summary by destination prefix.
30
+ * @property verifyServiceSid - Filter the verification attempts considered on the summary by verify service.
31
+ */
32
+ interface VerificationAttemptsSummaryInstanceFetchOptions {
33
+ channel?: VerificationAttemptsSummaryChannels;
34
+ country?: string;
35
+ dateCreatedAfter?: Date;
36
+ dateCreatedBefore?: Date;
37
+ destinationPrefix?: string;
38
+ verifyServiceSid?: string;
39
+ }
40
+
41
+ interface VerificationAttemptsSummaryListInstance {
42
+ /**
43
+ * @param sid - sid of instance
44
+ */
45
+ (sid: string): VerificationAttemptsSummaryContext;
46
+ /**
47
+ * Constructs a verification_attempts_summary
48
+ */
49
+ get(): VerificationAttemptsSummaryContext;
50
+ /**
51
+ * Provide a user-friendly representation
52
+ */
53
+ toJSON(): any;
54
+ }
55
+
56
+ interface VerificationAttemptsSummaryPayload extends VerificationAttemptsSummaryResource, Page.TwilioResponsePayload {
57
+ }
58
+
59
+ interface VerificationAttemptsSummaryResource {
60
+ conversion_rate_percentage: number;
61
+ total_attempts: number;
62
+ total_converted: number;
63
+ total_unconverted: number;
64
+ url: string;
65
+ }
66
+
67
+ interface VerificationAttemptsSummarySolution {
68
+ }
69
+
70
+
71
+ declare class VerificationAttemptsSummaryContext {
72
+ /**
73
+ * Initialize the VerificationAttemptsSummaryContext
74
+ *
75
+ * @param version - Version of the resource
76
+ */
77
+ constructor(version: V2);
78
+
79
+ /**
80
+ * fetch a VerificationAttemptsSummaryInstance
81
+ *
82
+ * @param callback - Callback to handle processed record
83
+ */
84
+ fetch(callback?: (error: Error | null, items: VerificationAttemptsSummaryInstance) => any): Promise<VerificationAttemptsSummaryInstance>;
85
+ /**
86
+ * fetch a VerificationAttemptsSummaryInstance
87
+ *
88
+ * @param opts - Options for request
89
+ * @param callback - Callback to handle processed record
90
+ */
91
+ fetch(opts?: VerificationAttemptsSummaryInstanceFetchOptions, callback?: (error: Error | null, items: VerificationAttemptsSummaryInstance) => any): Promise<VerificationAttemptsSummaryInstance>;
92
+ /**
93
+ * Provide a user-friendly representation
94
+ */
95
+ toJSON(): any;
96
+ }
97
+
98
+
99
+ declare class VerificationAttemptsSummaryInstance extends SerializableClass {
100
+ /**
101
+ * Initialize the VerificationAttemptsSummaryContext
102
+ *
103
+ * @param version - Version of the resource
104
+ * @param payload - The instance payload
105
+ */
106
+ constructor(version: V2, payload: VerificationAttemptsSummaryPayload);
107
+
108
+ private _proxy: VerificationAttemptsSummaryContext;
109
+ conversionRatePercentage: number;
110
+ /**
111
+ * fetch a VerificationAttemptsSummaryInstance
112
+ *
113
+ * @param callback - Callback to handle processed record
114
+ */
115
+ fetch(callback?: (error: Error | null, items: VerificationAttemptsSummaryInstance) => any): Promise<VerificationAttemptsSummaryInstance>;
116
+ /**
117
+ * fetch a VerificationAttemptsSummaryInstance
118
+ *
119
+ * @param opts - Options for request
120
+ * @param callback - Callback to handle processed record
121
+ */
122
+ fetch(opts?: VerificationAttemptsSummaryInstanceFetchOptions, callback?: (error: Error | null, items: VerificationAttemptsSummaryInstance) => any): Promise<VerificationAttemptsSummaryInstance>;
123
+ /**
124
+ * Provide a user-friendly representation
125
+ */
126
+ toJSON(): any;
127
+ totalAttempts: number;
128
+ totalConverted: number;
129
+ totalUnconverted: number;
130
+ url: string;
131
+ }
132
+
133
+
134
+ declare class VerificationAttemptsSummaryPage extends Page<V2, VerificationAttemptsSummaryPayload, VerificationAttemptsSummaryResource, VerificationAttemptsSummaryInstance> {
135
+ /**
136
+ * Initialize the VerificationAttemptsSummaryPage
137
+ *
138
+ * @param version - Version of the resource
139
+ * @param response - Response from the API
140
+ * @param solution - Path solution
141
+ */
142
+ constructor(version: V2, response: Response<string>, solution: VerificationAttemptsSummarySolution);
143
+
144
+ /**
145
+ * Build an instance of VerificationAttemptsSummaryInstance
146
+ *
147
+ * @param payload - Payload response from the API
148
+ */
149
+ getInstance(payload: VerificationAttemptsSummaryPayload): VerificationAttemptsSummaryInstance;
150
+ /**
151
+ * Provide a user-friendly representation
152
+ */
153
+ toJSON(): any;
154
+ }
155
+
156
+ export { VerificationAttemptsSummaryChannels, VerificationAttemptsSummaryContext, VerificationAttemptsSummaryInstance, VerificationAttemptsSummaryInstanceFetchOptions, VerificationAttemptsSummaryList, VerificationAttemptsSummaryListInstance, VerificationAttemptsSummaryPage, VerificationAttemptsSummaryPayload, VerificationAttemptsSummaryResource, VerificationAttemptsSummarySolution }
@@ -0,0 +1,362 @@
1
+ 'use strict';
2
+
3
+ /* jshint ignore:start */
4
+ /**
5
+ * This code was generated by
6
+ * \ / _ _ _| _ _
7
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
8
+ * / /
9
+ */
10
+ /* jshint ignore:end */
11
+
12
+ var Q = require('q'); /* jshint ignore:line */
13
+ var _ = require('lodash'); /* jshint ignore:line */
14
+ var util = require('util'); /* jshint ignore:line */
15
+ var Page = require('../../../base/Page'); /* jshint ignore:line */
16
+ var deserialize = require(
17
+ '../../../base/deserialize'); /* jshint ignore:line */
18
+ var serialize = require('../../../base/serialize'); /* jshint ignore:line */
19
+ var values = require('../../../base/values'); /* jshint ignore:line */
20
+
21
+ var VerificationAttemptsSummaryList;
22
+ var VerificationAttemptsSummaryPage;
23
+ var VerificationAttemptsSummaryInstance;
24
+ var VerificationAttemptsSummaryContext;
25
+
26
+ /* jshint ignore:start */
27
+ /**
28
+ * Initialize the VerificationAttemptsSummaryList
29
+ *
30
+ * @constructor Twilio.Verify.V2.VerificationAttemptsSummaryList
31
+ *
32
+ * @param {Twilio.Verify.V2} version - Version of the resource
33
+ */
34
+ /* jshint ignore:end */
35
+ VerificationAttemptsSummaryList = function
36
+ VerificationAttemptsSummaryList(version) {
37
+ /* jshint ignore:start */
38
+ /**
39
+ * @function verificationAttemptsSummary
40
+ * @memberof Twilio.Verify.V2#
41
+ *
42
+ * @param {string} sid - sid of instance
43
+ *
44
+ * @returns {Twilio.Verify.V2.VerificationAttemptsSummaryContext}
45
+ */
46
+ /* jshint ignore:end */
47
+ function VerificationAttemptsSummaryListInstance(sid) {
48
+ return VerificationAttemptsSummaryListInstance.get(sid);
49
+ }
50
+
51
+ VerificationAttemptsSummaryListInstance._version = version;
52
+ // Path Solution
53
+ VerificationAttemptsSummaryListInstance._solution = {};
54
+ /* jshint ignore:start */
55
+ /**
56
+ * Constructs a verification_attempts_summary
57
+ *
58
+ * @function get
59
+ * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryList#
60
+ *
61
+ * @returns {Twilio.Verify.V2.VerificationAttemptsSummaryContext}
62
+ */
63
+ /* jshint ignore:end */
64
+ VerificationAttemptsSummaryListInstance.get = function get() {
65
+ return new VerificationAttemptsSummaryContext(this._version);
66
+ };
67
+
68
+ /* jshint ignore:start */
69
+ /**
70
+ * Provide a user-friendly representation
71
+ *
72
+ * @function toJSON
73
+ * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryList#
74
+ *
75
+ * @returns Object
76
+ */
77
+ /* jshint ignore:end */
78
+ VerificationAttemptsSummaryListInstance.toJSON = function toJSON() {
79
+ return this._solution;
80
+ };
81
+
82
+ VerificationAttemptsSummaryListInstance[util.inspect.custom] = function
83
+ inspect(depth, options) {
84
+ return util.inspect(this.toJSON(), options);
85
+ };
86
+
87
+ return VerificationAttemptsSummaryListInstance;
88
+ };
89
+
90
+
91
+ /* jshint ignore:start */
92
+ /**
93
+ * Initialize the VerificationAttemptsSummaryPage
94
+ *
95
+ * @constructor Twilio.Verify.V2.VerificationAttemptsSummaryPage
96
+ *
97
+ * @param {V2} version - Version of the resource
98
+ * @param {Response<string>} response - Response from the API
99
+ * @param {VerificationAttemptsSummarySolution} solution - Path solution
100
+ *
101
+ * @returns VerificationAttemptsSummaryPage
102
+ */
103
+ /* jshint ignore:end */
104
+ VerificationAttemptsSummaryPage = function
105
+ VerificationAttemptsSummaryPage(version, response, solution) {
106
+ // Path Solution
107
+ this._solution = solution;
108
+
109
+ Page.prototype.constructor.call(this, version, response, this._solution);
110
+ };
111
+
112
+ _.extend(VerificationAttemptsSummaryPage.prototype, Page.prototype);
113
+ VerificationAttemptsSummaryPage.prototype.constructor = VerificationAttemptsSummaryPage;
114
+
115
+ /* jshint ignore:start */
116
+ /**
117
+ * Build an instance of VerificationAttemptsSummaryInstance
118
+ *
119
+ * @function getInstance
120
+ * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryPage#
121
+ *
122
+ * @param {VerificationAttemptsSummaryPayload} payload -
123
+ * Payload response from the API
124
+ *
125
+ * @returns VerificationAttemptsSummaryInstance
126
+ */
127
+ /* jshint ignore:end */
128
+ VerificationAttemptsSummaryPage.prototype.getInstance = function
129
+ getInstance(payload) {
130
+ return new VerificationAttemptsSummaryInstance(this._version, payload);
131
+ };
132
+
133
+ /* jshint ignore:start */
134
+ /**
135
+ * Provide a user-friendly representation
136
+ *
137
+ * @function toJSON
138
+ * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryPage#
139
+ *
140
+ * @returns Object
141
+ */
142
+ /* jshint ignore:end */
143
+ VerificationAttemptsSummaryPage.prototype.toJSON = function toJSON() {
144
+ let clone = {};
145
+ _.forOwn(this, function(value, key) {
146
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
147
+ clone[key] = value;
148
+ }
149
+ });
150
+ return clone;
151
+ };
152
+
153
+ VerificationAttemptsSummaryPage.prototype[util.inspect.custom] = function
154
+ inspect(depth, options) {
155
+ return util.inspect(this.toJSON(), options);
156
+ };
157
+
158
+
159
+ /* jshint ignore:start */
160
+ /**
161
+ * Initialize the VerificationAttemptsSummaryContext
162
+ *
163
+ * @constructor Twilio.Verify.V2.VerificationAttemptsSummaryInstance
164
+ *
165
+ * @property {number} totalAttempts - Total of attempts made.
166
+ * @property {number} totalConverted - Total of attempts confirmed by the end user.
167
+ * @property {number} totalUnconverted -
168
+ * Total of attempts made that were not confirmed by the end user.
169
+ * @property {number} conversionRatePercentage -
170
+ * Percentage of the confirmed messages over the total.
171
+ * @property {string} url - The url
172
+ *
173
+ * @param {V2} version - Version of the resource
174
+ * @param {VerificationAttemptsSummaryPayload} payload - The instance payload
175
+ */
176
+ /* jshint ignore:end */
177
+ VerificationAttemptsSummaryInstance = function
178
+ VerificationAttemptsSummaryInstance(version, payload) {
179
+ this._version = version;
180
+
181
+ // Marshaled Properties
182
+ this.totalAttempts = deserialize.integer(payload.total_attempts); // jshint ignore:line
183
+ this.totalConverted = deserialize.integer(payload.total_converted); // jshint ignore:line
184
+ this.totalUnconverted = deserialize.integer(payload.total_unconverted); // jshint ignore:line
185
+ this.conversionRatePercentage = deserialize.decimal(payload.conversion_rate_percentage); // jshint ignore:line
186
+ this.url = payload.url; // jshint ignore:line
187
+
188
+ // Context
189
+ this._context = undefined;
190
+ this._solution = {};
191
+ };
192
+
193
+ Object.defineProperty(VerificationAttemptsSummaryInstance.prototype,
194
+ '_proxy', {
195
+ get: function() {
196
+ if (!this._context) {
197
+ this._context = new VerificationAttemptsSummaryContext(this._version);
198
+ }
199
+
200
+ return this._context;
201
+ }
202
+ });
203
+
204
+ /* jshint ignore:start */
205
+ /**
206
+ * fetch a VerificationAttemptsSummaryInstance
207
+ *
208
+ * @function fetch
209
+ * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryInstance#
210
+ *
211
+ * @param {object} [opts] - Options for request
212
+ * @param {string} [opts.verifyServiceSid] -
213
+ * Filter the verification attempts considered on the summary by verify service.
214
+ * @param {Date} [opts.dateCreatedAfter] -
215
+ * Consider verification attempts create after this date on the summary.
216
+ * @param {Date} [opts.dateCreatedBefore] -
217
+ * Consider verification attempts created before this date on the summary.
218
+ * @param {string} [opts.country] -
219
+ * Filter verification attempts considered on the summary by destination country.
220
+ * @param {verification_attempts_summary.channels} [opts.channel] -
221
+ * Filter verification attempts considered on the summary by communication channel.
222
+ * @param {string} [opts.destinationPrefix] -
223
+ * Filters the attempts considered on the summary by destination prefix.
224
+ * @param {function} [callback] - Callback to handle processed record
225
+ *
226
+ * @returns {Promise} Resolves to processed VerificationAttemptsSummaryInstance
227
+ */
228
+ /* jshint ignore:end */
229
+ VerificationAttemptsSummaryInstance.prototype.fetch = function fetch(opts,
230
+ callback) {
231
+ return this._proxy.fetch(opts, callback);
232
+ };
233
+
234
+ /* jshint ignore:start */
235
+ /**
236
+ * Provide a user-friendly representation
237
+ *
238
+ * @function toJSON
239
+ * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryInstance#
240
+ *
241
+ * @returns Object
242
+ */
243
+ /* jshint ignore:end */
244
+ VerificationAttemptsSummaryInstance.prototype.toJSON = function toJSON() {
245
+ let clone = {};
246
+ _.forOwn(this, function(value, key) {
247
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
248
+ clone[key] = value;
249
+ }
250
+ });
251
+ return clone;
252
+ };
253
+
254
+ VerificationAttemptsSummaryInstance.prototype[util.inspect.custom] = function
255
+ inspect(depth, options) {
256
+ return util.inspect(this.toJSON(), options);
257
+ };
258
+
259
+
260
+ /* jshint ignore:start */
261
+ /**
262
+ * Initialize the VerificationAttemptsSummaryContext
263
+ *
264
+ * @constructor Twilio.Verify.V2.VerificationAttemptsSummaryContext
265
+ *
266
+ * @param {V2} version - Version of the resource
267
+ */
268
+ /* jshint ignore:end */
269
+ VerificationAttemptsSummaryContext = function
270
+ VerificationAttemptsSummaryContext(version) {
271
+ this._version = version;
272
+
273
+ // Path Solution
274
+ this._solution = {};
275
+ this._uri = `/Attempts/Summary`;
276
+ };
277
+
278
+ /* jshint ignore:start */
279
+ /**
280
+ * fetch a VerificationAttemptsSummaryInstance
281
+ *
282
+ * @function fetch
283
+ * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryContext#
284
+ *
285
+ * @param {object} [opts] - Options for request
286
+ * @param {string} [opts.verifyServiceSid] -
287
+ * Filter the verification attempts considered on the summary by verify service.
288
+ * @param {Date} [opts.dateCreatedAfter] -
289
+ * Consider verification attempts create after this date on the summary.
290
+ * @param {Date} [opts.dateCreatedBefore] -
291
+ * Consider verification attempts created before this date on the summary.
292
+ * @param {string} [opts.country] -
293
+ * Filter verification attempts considered on the summary by destination country.
294
+ * @param {verification_attempts_summary.channels} [opts.channel] -
295
+ * Filter verification attempts considered on the summary by communication channel.
296
+ * @param {string} [opts.destinationPrefix] -
297
+ * Filters the attempts considered on the summary by destination prefix.
298
+ * @param {function} [callback] - Callback to handle processed record
299
+ *
300
+ * @returns {Promise} Resolves to processed VerificationAttemptsSummaryInstance
301
+ */
302
+ /* jshint ignore:end */
303
+ VerificationAttemptsSummaryContext.prototype.fetch = function fetch(opts,
304
+ callback) {
305
+ if (_.isFunction(opts)) {
306
+ callback = opts;
307
+ opts = {};
308
+ }
309
+ opts = opts || {};
310
+
311
+ var deferred = Q.defer();
312
+ var data = values.of({
313
+ 'VerifyServiceSid': _.get(opts, 'verifyServiceSid'),
314
+ 'DateCreatedAfter': serialize.iso8601DateTime(_.get(opts, 'dateCreatedAfter')),
315
+ 'DateCreatedBefore': serialize.iso8601DateTime(_.get(opts, 'dateCreatedBefore')),
316
+ 'Country': _.get(opts, 'country'),
317
+ 'Channel': _.get(opts, 'channel'),
318
+ 'DestinationPrefix': _.get(opts, 'destinationPrefix')
319
+ });
320
+
321
+ var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data});
322
+
323
+ promise = promise.then(function(payload) {
324
+ deferred.resolve(new VerificationAttemptsSummaryInstance(this._version, payload));
325
+ }.bind(this));
326
+
327
+ promise.catch(function(error) {
328
+ deferred.reject(error);
329
+ });
330
+
331
+ if (_.isFunction(callback)) {
332
+ deferred.promise.nodeify(callback);
333
+ }
334
+
335
+ return deferred.promise;
336
+ };
337
+
338
+ /* jshint ignore:start */
339
+ /**
340
+ * Provide a user-friendly representation
341
+ *
342
+ * @function toJSON
343
+ * @memberof Twilio.Verify.V2.VerificationAttemptsSummaryContext#
344
+ *
345
+ * @returns Object
346
+ */
347
+ /* jshint ignore:end */
348
+ VerificationAttemptsSummaryContext.prototype.toJSON = function toJSON() {
349
+ return this._solution;
350
+ };
351
+
352
+ VerificationAttemptsSummaryContext.prototype[util.inspect.custom] = function
353
+ inspect(depth, options) {
354
+ return util.inspect(this.toJSON(), options);
355
+ };
356
+
357
+ module.exports = {
358
+ VerificationAttemptsSummaryList: VerificationAttemptsSummaryList,
359
+ VerificationAttemptsSummaryPage: VerificationAttemptsSummaryPage,
360
+ VerificationAttemptsSummaryInstance: VerificationAttemptsSummaryInstance,
361
+ VerificationAttemptsSummaryContext: VerificationAttemptsSummaryContext
362
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twilio",
3
3
  "description": "A Twilio helper library",
4
- "version": "3.76.0",
4
+ "version": "3.76.1",
5
5
  "author": "API Team <api@twilio.com>",
6
6
  "contributors": [
7
7
  {