@ngrok/ngrok-api 0.2.0 → 0.8.0

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.
Files changed (244) hide show
  1. package/README.md +0 -28
  2. package/docs/CNAME +1 -0
  3. package/docs/assets/js/search.js +1 -1
  4. package/docs/classes/client.Ngrok.html +204 -119
  5. package/docs/classes/services.APIKeys.html +6 -105
  6. package/docs/classes/services.AbuseReports.html +3 -102
  7. package/docs/classes/{services.IPWhitelist.html → services.AgentIngresses.html} +41 -148
  8. package/docs/classes/services.CertificateAuthorities.html +6 -105
  9. package/docs/classes/services.Credentials.html +6 -105
  10. package/docs/classes/services.EdgeRouteBackendModule.html +270 -0
  11. package/docs/classes/services.EdgeRouteCircuitBreakerModule.html +270 -0
  12. package/docs/classes/services.EdgeRouteCompressionModule.html +270 -0
  13. package/docs/classes/services.EdgeRouteIPRestrictionModule.html +270 -0
  14. package/docs/classes/services.EdgeRouteOAuthModule.html +270 -0
  15. package/docs/classes/services.EdgeRouteOIDCModule.html +270 -0
  16. package/docs/classes/{services.EndpointResponseHeadersModule.html → services.EdgeRouteRequestHeadersModule.html} +28 -127
  17. package/docs/classes/services.EdgeRouteResponseHeadersModule.html +270 -0
  18. package/docs/classes/services.EdgeRouteSAMLModule.html +270 -0
  19. package/docs/classes/services.EdgeRouteWebhookVerificationModule.html +270 -0
  20. package/docs/classes/services.EdgeRouteWebsocketTCPConverterModule.html +270 -0
  21. package/docs/classes/services.EdgesHTTPS.html +343 -0
  22. package/docs/classes/services.EdgesHTTPSRoutes.html +317 -0
  23. package/docs/classes/services.EdgesTCP.html +343 -0
  24. package/docs/classes/services.EdgesTLS.html +343 -0
  25. package/docs/classes/services.Endpoints.html +256 -0
  26. package/docs/classes/services.EventDestinations.html +7 -106
  27. package/docs/classes/services.EventSources.html +6 -105
  28. package/docs/classes/services.EventSubscriptions.html +6 -105
  29. package/docs/classes/{services.EventStreams.html → services.FailoverBackends.html} +51 -140
  30. package/docs/classes/services.HTTPResponseBackends.html +318 -0
  31. package/docs/classes/{services.EndpointMutualTLSModule.html → services.HTTPSEdgeMutualTLSModule.html} +22 -121
  32. package/docs/classes/{services.EndpointTLSTerminationModule.html → services.HTTPSEdgeTLSTerminationModule.html} +22 -121
  33. package/docs/classes/services.IPPolicies.html +6 -105
  34. package/docs/classes/services.IPPolicyRules.html +6 -105
  35. package/docs/classes/services.IPRestrictions.html +7 -106
  36. package/docs/classes/services.ReservedAddrs.html +6 -137
  37. package/docs/classes/services.ReservedDomains.html +8 -171
  38. package/docs/classes/services.SSHCertificateAuthorities.html +6 -105
  39. package/docs/classes/services.SSHCredentials.html +6 -105
  40. package/docs/classes/services.SSHHostCertificates.html +6 -105
  41. package/docs/classes/services.SSHUserCertificates.html +6 -105
  42. package/docs/classes/{services.EndpointSAMLModule.html → services.TCPEdgeBackendModule.html} +25 -124
  43. package/docs/classes/{services.EndpointIPPolicyModule.html → services.TCPEdgeIPRestrictionModule.html} +22 -121
  44. package/docs/classes/services.TLSCertificates.html +6 -105
  45. package/docs/classes/{services.EndpointLoggingModule.html → services.TLSEdgeBackendModule.html} +25 -124
  46. package/docs/classes/{services.EndpointOIDCModule.html → services.TLSEdgeIPRestrictionModule.html} +25 -124
  47. package/docs/classes/{services.EndpointOAuthModule.html → services.TLSEdgeMutualTLSModule.html} +25 -124
  48. package/docs/classes/services.TLSEdgeTLSTerminationModule.html +270 -0
  49. package/docs/classes/services.TunnelGroupBackends.html +351 -0
  50. package/docs/classes/services.TunnelSessions.html +6 -105
  51. package/docs/classes/services.Tunnels.html +34 -101
  52. package/docs/classes/services.WeightedBackends.html +353 -0
  53. package/docs/index.html +0 -27
  54. package/docs/interfaces/client.NgrokConfig.html +2 -2
  55. package/docs/interfaces/datatypes.APIKey.html +6 -6
  56. package/docs/interfaces/datatypes.APIKeyCreate.html +2 -2
  57. package/docs/interfaces/datatypes.APIKeyList.html +3 -3
  58. package/docs/interfaces/datatypes.APIKeyUpdate.html +3 -3
  59. package/docs/interfaces/datatypes.AWSAuth.html +2 -2
  60. package/docs/interfaces/datatypes.AWSCredentials.html +2 -2
  61. package/docs/interfaces/datatypes.AWSRole.html +1 -1
  62. package/docs/interfaces/datatypes.AbuseReport.html +7 -7
  63. package/docs/interfaces/datatypes.AbuseReportCreate.html +2 -2
  64. package/docs/interfaces/datatypes.AbuseReportHostname.html +2 -2
  65. package/docs/interfaces/{datatypes.EventStream.html → datatypes.AgentIngress.html} +52 -71
  66. package/docs/interfaces/datatypes.AgentIngressCreate.html +205 -0
  67. package/docs/interfaces/datatypes.AgentIngressList.html +205 -0
  68. package/docs/interfaces/{datatypes.IPWhitelistEntryUpdate.html → datatypes.AgentIngressUpdate.html} +16 -16
  69. package/docs/interfaces/datatypes.CertificateAuthority.html +11 -11
  70. package/docs/interfaces/datatypes.CertificateAuthorityCreate.html +3 -3
  71. package/docs/interfaces/datatypes.CertificateAuthorityList.html +3 -3
  72. package/docs/interfaces/datatypes.CertificateAuthorityUpdate.html +3 -3
  73. package/docs/interfaces/datatypes.Credential.html +7 -7
  74. package/docs/interfaces/datatypes.CredentialCreate.html +3 -3
  75. package/docs/interfaces/datatypes.CredentialList.html +3 -3
  76. package/docs/interfaces/datatypes.CredentialUpdate.html +4 -4
  77. package/docs/interfaces/{datatypes.EndpointCircuitBreakerReplace.html → datatypes.EdgeBackendReplace.html} +12 -12
  78. package/docs/interfaces/{datatypes.EndpointIPPolicyReplace.html → datatypes.EdgeIPRestrictionReplace.html} +11 -11
  79. package/docs/interfaces/{datatypes.EndpointMutualTLSReplace.html → datatypes.EdgeMutualTLSReplace.html} +11 -11
  80. package/docs/interfaces/datatypes.EdgeRouteBackendReplace.html +190 -0
  81. package/docs/interfaces/datatypes.EdgeRouteCircuitBreakerReplace.html +190 -0
  82. package/docs/interfaces/{datatypes.EndpointCompressionReplace.html → datatypes.EdgeRouteCompressionReplace.html} +25 -11
  83. package/docs/interfaces/datatypes.EdgeRouteIPRestrictionReplace.html +190 -0
  84. package/docs/interfaces/{datatypes.ReservedDomainCertNSTarget.html → datatypes.EdgeRouteItem.html} +19 -19
  85. package/docs/interfaces/{datatypes.EndpointOAuthReplace.html → datatypes.EdgeRouteOAuthReplace.html} +25 -11
  86. package/docs/interfaces/datatypes.EdgeRouteOIDCReplace.html +190 -0
  87. package/docs/interfaces/{datatypes.EndpointRequestHeadersReplace.html → datatypes.EdgeRouteRequestHeadersReplace.html} +25 -11
  88. package/docs/interfaces/datatypes.EdgeRouteResponseHeadersReplace.html +190 -0
  89. package/docs/interfaces/{datatypes.EndpointSAMLReplace.html → datatypes.EdgeRouteSAMLReplace.html} +25 -11
  90. package/docs/interfaces/{datatypes.EndpointWebhookValidationReplace.html → datatypes.EdgeRouteWebhookVerificationReplace.html} +25 -11
  91. package/docs/interfaces/datatypes.EdgeRouteWebsocketTCPConverterReplace.html +190 -0
  92. package/docs/interfaces/{datatypes.EndpointResponseHeadersReplace.html → datatypes.EdgeTLSTerminationAtEdgeReplace.html} +12 -12
  93. package/docs/interfaces/{datatypes.EndpointTLSTerminationReplace.html → datatypes.EdgeTLSTerminationReplace.html} +11 -11
  94. package/docs/interfaces/datatypes.Endpoint.html +395 -0
  95. package/docs/interfaces/{datatypes.EndpointLogging.html → datatypes.EndpointBackend.html} +19 -19
  96. package/docs/interfaces/{datatypes.EndpointLoggingMutate.html → datatypes.EndpointBackendMutate.html} +19 -19
  97. package/docs/interfaces/datatypes.EndpointCircuitBreaker.html +6 -6
  98. package/docs/interfaces/datatypes.EndpointCompression.html +1 -1
  99. package/docs/interfaces/datatypes.EndpointIPPolicy.html +2 -2
  100. package/docs/interfaces/datatypes.EndpointIPPolicyMutate.html +2 -2
  101. package/docs/interfaces/{datatypes.EndpointConfigurationList.html → datatypes.EndpointList.html} +19 -19
  102. package/docs/interfaces/datatypes.EndpointMutualTLS.html +2 -2
  103. package/docs/interfaces/datatypes.EndpointMutualTLSMutate.html +2 -2
  104. package/docs/interfaces/datatypes.EndpointOAuth.html +7 -7
  105. package/docs/interfaces/datatypes.EndpointOAuthFacebook.html +5 -5
  106. package/docs/interfaces/datatypes.EndpointOAuthGitHub.html +7 -7
  107. package/docs/interfaces/datatypes.EndpointOAuthGoogle.html +5 -5
  108. package/docs/interfaces/datatypes.EndpointOAuthMicrosoft.html +5 -5
  109. package/docs/interfaces/datatypes.EndpointOAuthProvider.html +4 -4
  110. package/docs/interfaces/datatypes.EndpointOIDC.html +9 -9
  111. package/docs/interfaces/datatypes.EndpointRequestHeaders.html +3 -3
  112. package/docs/interfaces/datatypes.EndpointResponseHeaders.html +3 -3
  113. package/docs/interfaces/datatypes.EndpointSAML.html +33 -14
  114. package/docs/interfaces/datatypes.EndpointSAMLMutate.html +28 -9
  115. package/docs/interfaces/datatypes.EndpointTLSTermination.html +3 -3
  116. package/docs/interfaces/datatypes.EndpointTLSTerminationAtEdge.html +186 -0
  117. package/docs/interfaces/datatypes.EndpointWebhookValidation.html +4 -4
  118. package/docs/interfaces/{datatypes.EndpointOIDCReplace.html → datatypes.EndpointWebsocketTCPConverter.html} +16 -25
  119. package/docs/interfaces/datatypes.Error.html +4 -4
  120. package/docs/interfaces/datatypes.EventDestination.html +7 -7
  121. package/docs/interfaces/datatypes.EventDestinationCreate.html +4 -4
  122. package/docs/interfaces/datatypes.EventDestinationList.html +3 -3
  123. package/docs/interfaces/datatypes.EventDestinationUpdate.html +5 -5
  124. package/docs/interfaces/datatypes.EventSource.html +2 -2
  125. package/docs/interfaces/datatypes.EventSourceCreate.html +2 -2
  126. package/docs/interfaces/datatypes.EventSourceItem.html +2 -2
  127. package/docs/interfaces/datatypes.EventSourceList.html +2 -2
  128. package/docs/interfaces/datatypes.EventSourcePaging.html +1 -1
  129. package/docs/interfaces/datatypes.EventSourceReplace.html +1 -1
  130. package/docs/interfaces/datatypes.EventSourceUpdate.html +2 -2
  131. package/docs/interfaces/datatypes.EventSubscription.html +7 -7
  132. package/docs/interfaces/datatypes.EventSubscriptionCreate.html +5 -5
  133. package/docs/interfaces/datatypes.EventSubscriptionList.html +3 -3
  134. package/docs/interfaces/datatypes.EventSubscriptionUpdate.html +6 -6
  135. package/docs/interfaces/datatypes.EventTarget.html +3 -3
  136. package/docs/interfaces/datatypes.EventTargetCloudwatchLogs.html +2 -2
  137. package/docs/interfaces/datatypes.EventTargetFirehose.html +2 -2
  138. package/docs/interfaces/datatypes.EventTargetKinesis.html +2 -2
  139. package/docs/interfaces/{datatypes.IPWhitelistEntry.html → datatypes.FailoverBackend.html} +41 -41
  140. package/docs/interfaces/{datatypes.IPWhitelistEntryCreate.html → datatypes.FailoverBackendCreate.html} +23 -23
  141. package/docs/interfaces/datatypes.FailoverBackendList.html +205 -0
  142. package/docs/interfaces/datatypes.FailoverBackendUpdate.html +219 -0
  143. package/docs/interfaces/datatypes.HTTPResponseBackend.html +295 -0
  144. package/docs/interfaces/datatypes.HTTPResponseBackendCreate.html +243 -0
  145. package/docs/interfaces/datatypes.HTTPResponseBackendList.html +190 -0
  146. package/docs/interfaces/datatypes.HTTPResponseBackendUpdate.html +257 -0
  147. package/docs/interfaces/datatypes.HTTPSEdge.html +314 -0
  148. package/docs/interfaces/datatypes.HTTPSEdgeCreate.html +238 -0
  149. package/docs/interfaces/datatypes.HTTPSEdgeList.html +205 -0
  150. package/docs/interfaces/{datatypes.EndpointConfigurationUpdate.html → datatypes.HTTPSEdgeRoute.html} +154 -78
  151. package/docs/interfaces/{datatypes.EndpointConfigurationCreate.html → datatypes.HTTPSEdgeRouteCreate.html} +108 -89
  152. package/docs/interfaces/{datatypes.EndpointConfiguration.html → datatypes.HTTPSEdgeRouteUpdate.html} +104 -123
  153. package/docs/interfaces/datatypes.HTTPSEdgeUpdate.html +257 -0
  154. package/docs/interfaces/datatypes.IPPolicy.html +5 -24
  155. package/docs/interfaces/datatypes.IPPolicyCreate.html +2 -21
  156. package/docs/interfaces/datatypes.IPPolicyList.html +3 -3
  157. package/docs/interfaces/datatypes.IPPolicyRule.html +26 -7
  158. package/docs/interfaces/datatypes.IPPolicyRuleCreate.html +23 -4
  159. package/docs/interfaces/datatypes.IPPolicyRuleList.html +3 -3
  160. package/docs/interfaces/datatypes.IPPolicyRuleUpdate.html +4 -4
  161. package/docs/interfaces/datatypes.IPPolicyUpdate.html +3 -3
  162. package/docs/interfaces/datatypes.IPRestriction.html +8 -8
  163. package/docs/interfaces/datatypes.IPRestrictionCreate.html +5 -5
  164. package/docs/interfaces/datatypes.IPRestrictionList.html +3 -3
  165. package/docs/interfaces/datatypes.IPRestrictionUpdate.html +5 -5
  166. package/docs/interfaces/datatypes.Item.html +1 -1
  167. package/docs/interfaces/datatypes.Paging.html +2 -2
  168. package/docs/interfaces/datatypes.Ref.html +2 -2
  169. package/docs/interfaces/datatypes.ReservedAddr.html +7 -26
  170. package/docs/interfaces/datatypes.ReservedAddrCreate.html +3 -22
  171. package/docs/interfaces/datatypes.ReservedAddrList.html +3 -3
  172. package/docs/interfaces/datatypes.ReservedAddrUpdate.html +3 -22
  173. package/docs/interfaces/datatypes.ReservedDomain.html +30 -49
  174. package/docs/interfaces/datatypes.ReservedDomainCertJob.html +4 -23
  175. package/docs/interfaces/datatypes.ReservedDomainCertPolicy.html +2 -2
  176. package/docs/interfaces/datatypes.ReservedDomainCertStatus.html +2 -2
  177. package/docs/interfaces/datatypes.ReservedDomainCreate.html +6 -44
  178. package/docs/interfaces/datatypes.ReservedDomainList.html +3 -3
  179. package/docs/interfaces/datatypes.ReservedDomainUpdate.html +5 -43
  180. package/docs/interfaces/datatypes.SSHCertificateAuthority.html +7 -7
  181. package/docs/interfaces/datatypes.SSHCertificateAuthorityCreate.html +5 -5
  182. package/docs/interfaces/datatypes.SSHCertificateAuthorityList.html +3 -3
  183. package/docs/interfaces/datatypes.SSHCertificateAuthorityUpdate.html +3 -3
  184. package/docs/interfaces/datatypes.SSHCredential.html +7 -7
  185. package/docs/interfaces/datatypes.SSHCredentialCreate.html +4 -4
  186. package/docs/interfaces/datatypes.SSHCredentialList.html +3 -3
  187. package/docs/interfaces/datatypes.SSHCredentialUpdate.html +4 -4
  188. package/docs/interfaces/datatypes.SSHHostCertificate.html +12 -12
  189. package/docs/interfaces/datatypes.SSHHostCertificateCreate.html +7 -7
  190. package/docs/interfaces/datatypes.SSHHostCertificateList.html +3 -3
  191. package/docs/interfaces/datatypes.SSHHostCertificateUpdate.html +3 -3
  192. package/docs/interfaces/datatypes.SSHUserCertificate.html +14 -14
  193. package/docs/interfaces/datatypes.SSHUserCertificateCreate.html +9 -9
  194. package/docs/interfaces/datatypes.SSHUserCertificateList.html +3 -3
  195. package/docs/interfaces/datatypes.SSHUserCertificateUpdate.html +3 -3
  196. package/docs/interfaces/datatypes.TCPEdge.html +295 -0
  197. package/docs/interfaces/datatypes.TCPEdgeCreate.html +238 -0
  198. package/docs/interfaces/{datatypes.IPWhitelistEntryList.html → datatypes.TCPEdgeList.html} +22 -22
  199. package/docs/interfaces/{datatypes.EventStreamUpdate.html → datatypes.TCPEdgeUpdate.html} +43 -48
  200. package/docs/interfaces/datatypes.TLSCertificate.html +21 -21
  201. package/docs/interfaces/datatypes.TLSCertificateCreate.html +4 -4
  202. package/docs/interfaces/datatypes.TLSCertificateList.html +3 -3
  203. package/docs/interfaces/datatypes.TLSCertificateSANs.html +2 -2
  204. package/docs/interfaces/datatypes.TLSCertificateUpdate.html +3 -3
  205. package/docs/interfaces/datatypes.TLSEdge.html +323 -0
  206. package/docs/interfaces/datatypes.TLSEdgeCreate.html +266 -0
  207. package/docs/interfaces/{datatypes.EventStreamList.html → datatypes.TLSEdgeList.html} +23 -23
  208. package/docs/interfaces/datatypes.TLSEdgeUpdate.html +285 -0
  209. package/docs/interfaces/datatypes.Tunnel.html +85 -9
  210. package/docs/interfaces/datatypes.TunnelGroupBackend.html +281 -0
  211. package/docs/interfaces/datatypes.TunnelGroupBackendCreate.html +205 -0
  212. package/docs/interfaces/datatypes.TunnelGroupBackendList.html +205 -0
  213. package/docs/interfaces/datatypes.TunnelGroupBackendUpdate.html +219 -0
  214. package/docs/interfaces/datatypes.TunnelList.html +3 -3
  215. package/docs/interfaces/datatypes.TunnelSession.html +10 -10
  216. package/docs/interfaces/datatypes.TunnelSessionList.html +3 -3
  217. package/docs/interfaces/datatypes.TunnelSessionsUpdate.html +1 -1
  218. package/docs/interfaces/{datatypes.EventStreamCreate.html → datatypes.WeightedBackend.html} +44 -44
  219. package/docs/interfaces/datatypes.WeightedBackendCreate.html +205 -0
  220. package/docs/interfaces/datatypes.WeightedBackendList.html +205 -0
  221. package/docs/interfaces/datatypes.WeightedBackendUpdate.html +219 -0
  222. package/docs/modules/datatypes.html +213 -89
  223. package/docs/modules/services.html +89 -33
  224. package/lib/client.d.ts +54 -24
  225. package/lib/client.d.ts.map +1 -1
  226. package/lib/client.js +45 -22
  227. package/lib/client.js.map +1 -1
  228. package/lib/datatypes.d.ts +617 -281
  229. package/lib/datatypes.d.ts.map +1 -1
  230. package/lib/services.d.ts +385 -169
  231. package/lib/services.d.ts.map +1 -1
  232. package/lib/services.js +1432 -597
  233. package/lib/services.js.map +1 -1
  234. package/package.json +2 -2
  235. package/src/client.ts +98 -45
  236. package/src/datatypes.ts +669 -302
  237. package/src/services.ts +1426 -610
  238. package/docs/classes/services.EndpointCircuitBreakerModule.html +0 -369
  239. package/docs/classes/services.EndpointCompressionModule.html +0 -369
  240. package/docs/classes/services.EndpointConfigurations.html +0 -451
  241. package/docs/classes/services.EndpointRequestHeadersModule.html +0 -369
  242. package/docs/classes/services.EndpointWebhookValidationModule.html +0 -369
  243. package/docs/interfaces/datatypes.EndpointLoggingReplace.html +0 -176
  244. package/test/endpointConfigurations.test.js +0 -67
package/src/services.ts CHANGED
@@ -39,6 +39,104 @@ export class AbuseReports {
39
39
  }
40
40
  }
41
41
 
42
+ export class AgentIngresses {
43
+ private httpClient: Wretcher;
44
+
45
+ /** Do not construct this object directly, use the <code>agentIngresses</code> property of an <code>Ngrok</code> client object instead. */
46
+ public constructor(httpClient: Wretcher) {
47
+ this.httpClient = httpClient;
48
+ }
49
+ /**
50
+ * Create a new Agent Ingress. The ngrok agent can be configured to connect to ngrok via the new set of addresses on the returned Agent Ingress.
51
+ */
52
+ public create(
53
+ arg: datatypes.AgentIngressCreate
54
+ ): Promise<datatypes.AgentIngress> {
55
+ return this.httpClient
56
+ .url(`/agent_ingresses`)
57
+ .post(util.serializeArgument(arg))
58
+ .json(payload => util.deserializeResult(payload))
59
+ .then(f => f, util.onRejected);
60
+ }
61
+
62
+ /**
63
+ * Delete an Agent Ingress by ID
64
+ */
65
+ public delete(arg: datatypes.Item): Promise<void> {
66
+ return this.httpClient
67
+ .url(`/agent_ingresses/${arg.id}`)
68
+ .delete()
69
+ .json(payload => util.deserializeResult(payload))
70
+ .then(f => f, util.onRejected);
71
+ }
72
+
73
+ /**
74
+ * Get the details of an Agent Ingress by ID.
75
+ */
76
+ public get(arg: datatypes.Item): Promise<datatypes.AgentIngress> {
77
+ return this.httpClient
78
+ .url(`/agent_ingresses/${arg.id}`)
79
+ .get()
80
+ .json(payload => util.deserializeResult(payload))
81
+ .then(f => f, util.onRejected);
82
+ }
83
+
84
+ /**
85
+ * List all Agent Ingresses owned by this account
86
+ */
87
+ public async list(): Promise<Array<datatypes.AgentIngress>> {
88
+ const array: Array<datatypes.AgentIngress> = [];
89
+ for await (const item of this._asyncList()) {
90
+ array.push(item);
91
+ }
92
+ return array;
93
+ }
94
+ private _pagedList(
95
+ arg: datatypes.Paging
96
+ ): Promise<datatypes.AgentIngressList> {
97
+ return this.httpClient
98
+ .url(`/agent_ingresses`)
99
+ .query(arg)
100
+ .get()
101
+ .json(payload => util.deserializeResult(payload))
102
+ .then(util.onFulfilled, util.onRejected);
103
+ }
104
+ private async *_asyncList() {
105
+ const limit = '100';
106
+ let nextPage = 'initial loop';
107
+ let page: datatypes.Paging = { limit: limit };
108
+
109
+ while (nextPage) {
110
+ const pagedList = await this._pagedList(page);
111
+ nextPage = pagedList.nextPageUri;
112
+ const items: datatypes.AgentIngress[] = pagedList.ingresses;
113
+
114
+ if (nextPage) {
115
+ page = {
116
+ beforeId: items[items.length - 1].id,
117
+ limit: limit,
118
+ };
119
+ }
120
+
121
+ for (const item of items) {
122
+ yield item;
123
+ }
124
+ }
125
+ }
126
+ /**
127
+ * Update attributes of an Agent Ingress by ID.
128
+ */
129
+ public update(
130
+ arg: datatypes.AgentIngressUpdate
131
+ ): Promise<datatypes.AgentIngress> {
132
+ return this.httpClient
133
+ .url(`/agent_ingresses/${arg.id}`)
134
+ .patch(util.serializeArgument(arg))
135
+ .json(payload => util.deserializeResult(payload))
136
+ .then(f => f, util.onRejected);
137
+ }
138
+ }
139
+
42
140
  /**
43
141
  * API Keys are used to authenticate to the [ngrok
44
142
  API](https://ngrok.com/docs/api#authentication). You may use the API itself
@@ -139,59 +237,58 @@ export class APIKeys {
139
237
  }
140
238
 
141
239
  /**
142
- * Certificate Authorities are x509 certificates that are used to sign other
143
- x509 certificates. Attach a Certificate Authority to the Mutual TLS module
144
- to verify that the TLS certificate presented by a client has been signed by
145
- this CA. Certificate Authorities are used only for mTLS validation only and
146
- thus a private key is not included in the resource.
240
+ * A Failover backend defines failover behavior within a list of referenced
241
+ backends. Traffic is sent to the first backend in the list. If that backend
242
+ is offline or no connection can be established, ngrok attempts to connect to
243
+ the next backend in the list until one is successful.
147
244
  */
148
- export class CertificateAuthorities {
245
+ export class FailoverBackends {
149
246
  private httpClient: Wretcher;
150
247
 
151
- /** Do not construct this object directly, use the <code>certificateAuthorities</code> property of an <code>Ngrok</code> client object instead. */
248
+ /** Do not construct this object directly, use the <code>failoverBackends</code> property of an <code>Ngrok</code> client object instead. */
152
249
  public constructor(httpClient: Wretcher) {
153
250
  this.httpClient = httpClient;
154
251
  }
155
252
  /**
156
- * Upload a new Certificate Authority
253
+ * Create a new Failover backend
157
254
  */
158
255
  public create(
159
- arg: datatypes.CertificateAuthorityCreate
160
- ): Promise<datatypes.CertificateAuthority> {
256
+ arg: datatypes.FailoverBackendCreate
257
+ ): Promise<datatypes.FailoverBackend> {
161
258
  return this.httpClient
162
- .url(`/certificate_authorities`)
259
+ .url(`/backends/failover`)
163
260
  .post(util.serializeArgument(arg))
164
261
  .json(payload => util.deserializeResult(payload))
165
262
  .then(f => f, util.onRejected);
166
263
  }
167
264
 
168
265
  /**
169
- * Delete a Certificate Authority
266
+ * Delete a Failover backend by ID. TODO what if used?
170
267
  */
171
268
  public delete(arg: datatypes.Item): Promise<void> {
172
269
  return this.httpClient
173
- .url(`/certificate_authorities/${arg.id}`)
270
+ .url(`/backends/failover/${arg.id}`)
174
271
  .delete()
175
272
  .json(payload => util.deserializeResult(payload))
176
273
  .then(f => f, util.onRejected);
177
274
  }
178
275
 
179
276
  /**
180
- * Get detailed information about a certficate authority
277
+ * Get detailed information about a Failover backend by ID
181
278
  */
182
- public get(arg: datatypes.Item): Promise<datatypes.CertificateAuthority> {
279
+ public get(arg: datatypes.Item): Promise<datatypes.FailoverBackend> {
183
280
  return this.httpClient
184
- .url(`/certificate_authorities/${arg.id}`)
281
+ .url(`/backends/failover/${arg.id}`)
185
282
  .get()
186
283
  .json(payload => util.deserializeResult(payload))
187
284
  .then(f => f, util.onRejected);
188
285
  }
189
286
 
190
287
  /**
191
- * List all Certificate Authority on this account
288
+ * List all Failover backends on this account
192
289
  */
193
- public async list(): Promise<Array<datatypes.CertificateAuthority>> {
194
- const array: Array<datatypes.CertificateAuthority> = [];
290
+ public async list(): Promise<Array<datatypes.FailoverBackend>> {
291
+ const array: Array<datatypes.FailoverBackend> = [];
195
292
  for await (const item of this._asyncList()) {
196
293
  array.push(item);
197
294
  }
@@ -199,9 +296,9 @@ export class CertificateAuthorities {
199
296
  }
200
297
  private _pagedList(
201
298
  arg: datatypes.Paging
202
- ): Promise<datatypes.CertificateAuthorityList> {
299
+ ): Promise<datatypes.FailoverBackendList> {
203
300
  return this.httpClient
204
- .url(`/certificate_authorities`)
301
+ .url(`/backends/failover`)
205
302
  .query(arg)
206
303
  .get()
207
304
  .json(payload => util.deserializeResult(payload))
@@ -215,8 +312,7 @@ export class CertificateAuthorities {
215
312
  while (nextPage) {
216
313
  const pagedList = await this._pagedList(page);
217
314
  nextPage = pagedList.nextPageUri;
218
- const items: datatypes.CertificateAuthority[] =
219
- pagedList.certificateAuthorities;
315
+ const items: datatypes.FailoverBackend[] = pagedList.backends;
220
316
 
221
317
  if (nextPage) {
222
318
  page = {
@@ -231,80 +327,64 @@ export class CertificateAuthorities {
231
327
  }
232
328
  }
233
329
  /**
234
- * Update attributes of a Certificate Authority by ID
330
+ * Update Failover backend by ID
235
331
  */
236
332
  public update(
237
- arg: datatypes.CertificateAuthorityUpdate
238
- ): Promise<datatypes.CertificateAuthority> {
333
+ arg: datatypes.FailoverBackendUpdate
334
+ ): Promise<datatypes.FailoverBackend> {
239
335
  return this.httpClient
240
- .url(`/certificate_authorities/${arg.id}`)
336
+ .url(`/backends/failover/${arg.id}`)
241
337
  .patch(util.serializeArgument(arg))
242
338
  .json(payload => util.deserializeResult(payload))
243
339
  .then(f => f, util.onRejected);
244
340
  }
245
341
  }
246
342
 
247
- /**
248
- * Tunnel Credentials are ngrok agent authtokens. They authorize the ngrok
249
- agent to connect the ngrok service as your account. They are installed with
250
- the `ngrok authtoken` command or by specifying it in the `ngrok.yml`
251
- configuration file with the `authtoken` property.
252
- */
253
- export class Credentials {
343
+ export class HTTPResponseBackends {
254
344
  private httpClient: Wretcher;
255
345
 
256
- /** Do not construct this object directly, use the <code>credentials</code> property of an <code>Ngrok</code> client object instead. */
346
+ /** Do not construct this object directly, use the <code>httpResponseBackends</code> property of an <code>Ngrok</code> client object instead. */
257
347
  public constructor(httpClient: Wretcher) {
258
348
  this.httpClient = httpClient;
259
349
  }
260
- /**
261
- * Create a new tunnel authtoken credential. This authtoken credential can be used to start a new tunnel session. The response to this API call is the only time the generated token is available. If you need it for future use, you must save it securely yourself.
262
- */
263
350
  public create(
264
- arg: datatypes.CredentialCreate
265
- ): Promise<datatypes.Credential> {
351
+ arg: datatypes.HTTPResponseBackendCreate
352
+ ): Promise<datatypes.HTTPResponseBackend> {
266
353
  return this.httpClient
267
- .url(`/credentials`)
354
+ .url(`/backends/http_response`)
268
355
  .post(util.serializeArgument(arg))
269
356
  .json(payload => util.deserializeResult(payload))
270
357
  .then(f => f, util.onRejected);
271
358
  }
272
359
 
273
- /**
274
- * Delete a tunnel authtoken credential by ID
275
- */
276
360
  public delete(arg: datatypes.Item): Promise<void> {
277
361
  return this.httpClient
278
- .url(`/credentials/${arg.id}`)
362
+ .url(`/backends/http_response/${arg.id}`)
279
363
  .delete()
280
364
  .json(payload => util.deserializeResult(payload))
281
365
  .then(f => f, util.onRejected);
282
366
  }
283
367
 
284
- /**
285
- * Get detailed information about a tunnel authtoken credential
286
- */
287
- public get(arg: datatypes.Item): Promise<datatypes.Credential> {
368
+ public get(arg: datatypes.Item): Promise<datatypes.HTTPResponseBackend> {
288
369
  return this.httpClient
289
- .url(`/credentials/${arg.id}`)
370
+ .url(`/backends/http_response/${arg.id}`)
290
371
  .get()
291
372
  .json(payload => util.deserializeResult(payload))
292
373
  .then(f => f, util.onRejected);
293
374
  }
294
375
 
295
- /**
296
- * List all tunnel authtoken credentials on this account
297
- */
298
- public async list(): Promise<Array<datatypes.Credential>> {
299
- const array: Array<datatypes.Credential> = [];
376
+ public async list(): Promise<Array<datatypes.HTTPResponseBackend>> {
377
+ const array: Array<datatypes.HTTPResponseBackend> = [];
300
378
  for await (const item of this._asyncList()) {
301
379
  array.push(item);
302
380
  }
303
381
  return array;
304
382
  }
305
- private _pagedList(arg: datatypes.Paging): Promise<datatypes.CredentialList> {
383
+ private _pagedList(
384
+ arg: datatypes.Paging
385
+ ): Promise<datatypes.HTTPResponseBackendList> {
306
386
  return this.httpClient
307
- .url(`/credentials`)
387
+ .url(`/backends/http_response`)
308
388
  .query(arg)
309
389
  .get()
310
390
  .json(payload => util.deserializeResult(payload))
@@ -318,7 +398,7 @@ export class Credentials {
318
398
  while (nextPage) {
319
399
  const pagedList = await this._pagedList(page);
320
400
  nextPage = pagedList.nextPageUri;
321
- const items: datatypes.Credential[] = pagedList.credentials;
401
+ const items: datatypes.HTTPResponseBackend[] = pagedList.backends;
322
402
 
323
403
  if (nextPage) {
324
404
  page = {
@@ -332,14 +412,11 @@ export class Credentials {
332
412
  }
333
413
  }
334
414
  }
335
- /**
336
- * Update attributes of an tunnel authtoken credential by ID
337
- */
338
415
  public update(
339
- arg: datatypes.CredentialUpdate
340
- ): Promise<datatypes.Credential> {
416
+ arg: datatypes.HTTPResponseBackendUpdate
417
+ ): Promise<datatypes.HTTPResponseBackend> {
341
418
  return this.httpClient
342
- .url(`/credentials/${arg.id}`)
419
+ .url(`/backends/http_response/${arg.id}`)
343
420
  .patch(util.serializeArgument(arg))
344
421
  .json(payload => util.deserializeResult(payload))
345
422
  .then(f => f, util.onRejected);
@@ -347,57 +424,56 @@ export class Credentials {
347
424
  }
348
425
 
349
426
  /**
350
- * Endpoint Configurations are a reusable group of modules that encapsulate how
351
- traffic to a domain or address is handled. Endpoint configurations are only
352
- applied to Domains and TCP Addresses they have been attached to.
427
+ * A Tunnel Group Backend balances traffic among all online tunnels that match
428
+ a label selector.
353
429
  */
354
- export class EndpointConfigurations {
430
+ export class TunnelGroupBackends {
355
431
  private httpClient: Wretcher;
356
432
 
357
- /** Do not construct this object directly, use the <code>endpointConfigurations</code> property of an <code>Ngrok</code> client object instead. */
433
+ /** Do not construct this object directly, use the <code>tunnelGroupBackends</code> property of an <code>Ngrok</code> client object instead. */
358
434
  public constructor(httpClient: Wretcher) {
359
435
  this.httpClient = httpClient;
360
436
  }
361
437
  /**
362
- * Create a new endpoint configuration
438
+ * Create a new TunnelGroup backend
363
439
  */
364
440
  public create(
365
- arg: datatypes.EndpointConfigurationCreate
366
- ): Promise<datatypes.EndpointConfiguration> {
441
+ arg: datatypes.TunnelGroupBackendCreate
442
+ ): Promise<datatypes.TunnelGroupBackend> {
367
443
  return this.httpClient
368
- .url(`/endpoint_configurations`)
444
+ .url(`/backends/tunnel_group`)
369
445
  .post(util.serializeArgument(arg))
370
446
  .json(payload => util.deserializeResult(payload))
371
447
  .then(f => f, util.onRejected);
372
448
  }
373
449
 
374
450
  /**
375
- * Delete an endpoint configuration. This operation will fail if the endpoint configuration is still referenced by any reserved domain or reserved address.
451
+ * Delete a TunnelGroup backend by ID. TODO what if used?
376
452
  */
377
453
  public delete(arg: datatypes.Item): Promise<void> {
378
454
  return this.httpClient
379
- .url(`/endpoint_configurations/${arg.id}`)
455
+ .url(`/backends/tunnel_group/${arg.id}`)
380
456
  .delete()
381
457
  .json(payload => util.deserializeResult(payload))
382
458
  .then(f => f, util.onRejected);
383
459
  }
384
460
 
385
461
  /**
386
- * Returns detailed information about an endpoint configuration
462
+ * Get detailed information about a TunnelGroup backend by ID
387
463
  */
388
- public get(arg: datatypes.Item): Promise<datatypes.EndpointConfiguration> {
464
+ public get(arg: datatypes.Item): Promise<datatypes.TunnelGroupBackend> {
389
465
  return this.httpClient
390
- .url(`/endpoint_configurations/${arg.id}`)
466
+ .url(`/backends/tunnel_group/${arg.id}`)
391
467
  .get()
392
468
  .json(payload => util.deserializeResult(payload))
393
469
  .then(f => f, util.onRejected);
394
470
  }
395
471
 
396
472
  /**
397
- * Returns a list of all endpoint configurations on this account
473
+ * List all TunnelGroup backends on this account
398
474
  */
399
- public async list(): Promise<Array<datatypes.EndpointConfiguration>> {
400
- const array: Array<datatypes.EndpointConfiguration> = [];
475
+ public async list(): Promise<Array<datatypes.TunnelGroupBackend>> {
476
+ const array: Array<datatypes.TunnelGroupBackend> = [];
401
477
  for await (const item of this._asyncList()) {
402
478
  array.push(item);
403
479
  }
@@ -405,9 +481,9 @@ export class EndpointConfigurations {
405
481
  }
406
482
  private _pagedList(
407
483
  arg: datatypes.Paging
408
- ): Promise<datatypes.EndpointConfigurationList> {
484
+ ): Promise<datatypes.TunnelGroupBackendList> {
409
485
  return this.httpClient
410
- .url(`/endpoint_configurations`)
486
+ .url(`/backends/tunnel_group`)
411
487
  .query(arg)
412
488
  .get()
413
489
  .json(payload => util.deserializeResult(payload))
@@ -421,8 +497,7 @@ export class EndpointConfigurations {
421
497
  while (nextPage) {
422
498
  const pagedList = await this._pagedList(page);
423
499
  nextPage = pagedList.nextPageUri;
424
- const items: datatypes.EndpointConfiguration[] =
425
- pagedList.endpointConfigurations;
500
+ const items: datatypes.TunnelGroupBackend[] = pagedList.backends;
426
501
 
427
502
  if (nextPage) {
428
503
  page = {
@@ -437,66 +512,72 @@ export class EndpointConfigurations {
437
512
  }
438
513
  }
439
514
  /**
440
- * Updates an endpoint configuration. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
515
+ * Update TunnelGroup backend by ID
441
516
  */
442
517
  public update(
443
- arg: datatypes.EndpointConfigurationUpdate
444
- ): Promise<datatypes.EndpointConfiguration> {
518
+ arg: datatypes.TunnelGroupBackendUpdate
519
+ ): Promise<datatypes.TunnelGroupBackend> {
445
520
  return this.httpClient
446
- .url(`/endpoint_configurations/${arg.id}`)
521
+ .url(`/backends/tunnel_group/${arg.id}`)
447
522
  .patch(util.serializeArgument(arg))
448
523
  .json(payload => util.deserializeResult(payload))
449
524
  .then(f => f, util.onRejected);
450
525
  }
451
526
  }
452
527
 
453
- export class EventStreams {
528
+ /**
529
+ * A Weighted Backend balances traffic among the referenced backends. Traffic
530
+ is assigned proportionally to each based on its weight. The percentage of
531
+ traffic is calculated by dividing a backend's weight by the sum of all
532
+ weights.
533
+ */
534
+ export class WeightedBackends {
454
535
  private httpClient: Wretcher;
455
536
 
456
- /** Do not construct this object directly, use the <code>eventStreams</code> property of an <code>Ngrok</code> client object instead. */
537
+ /** Do not construct this object directly, use the <code>weightedBackends</code> property of an <code>Ngrok</code> client object instead. */
457
538
  public constructor(httpClient: Wretcher) {
458
539
  this.httpClient = httpClient;
459
540
  }
460
541
  /**
461
- * Create a new Event Stream. It will not apply to anything until you associate it with one or more Endpoint Configs.
542
+ * Create a new Weighted backend
462
543
  */
463
544
  public create(
464
- arg: datatypes.EventStreamCreate
465
- ): Promise<datatypes.EventStream> {
545
+ arg: datatypes.WeightedBackendCreate
546
+ ): Promise<datatypes.WeightedBackend> {
466
547
  return this.httpClient
467
- .url(`/event_streams`)
548
+ .url(`/backends/weighted`)
468
549
  .post(util.serializeArgument(arg))
469
550
  .json(payload => util.deserializeResult(payload))
470
551
  .then(f => f, util.onRejected);
471
552
  }
472
553
 
473
554
  /**
474
- * Delete an Event Stream. Associated Event Destinations will be preserved.
555
+ * Delete a Weighted backend by ID. TODO what if used?
475
556
  */
476
557
  public delete(arg: datatypes.Item): Promise<void> {
477
558
  return this.httpClient
478
- .url(`/event_streams/${arg.id}`)
559
+ .url(`/backends/weighted/${arg.id}`)
479
560
  .delete()
480
561
  .json(payload => util.deserializeResult(payload))
481
562
  .then(f => f, util.onRejected);
482
563
  }
483
564
 
484
565
  /**
485
- * Get detailed information about an Event Stream by ID.
566
+ * Get detailed information about a Weighted backend by ID
486
567
  */
487
- public get(arg: datatypes.Item): Promise<datatypes.EventStream> {
568
+ public get(arg: datatypes.Item): Promise<datatypes.WeightedBackend> {
488
569
  return this.httpClient
489
- .url(`/event_streams/${arg.id}`)
570
+ .url(`/backends/weighted/${arg.id}`)
490
571
  .get()
491
572
  .json(payload => util.deserializeResult(payload))
492
573
  .then(f => f, util.onRejected);
493
574
  }
494
575
 
495
576
  /**
496
- * List all Event Streams available on this account.
577
+ * List all Weighted backends on this account
497
578
  */
498
- public async list(): Promise<Array<datatypes.EventStream>> {
499
- const array: Array<datatypes.EventStream> = [];
579
+ public async list(): Promise<Array<datatypes.WeightedBackend>> {
580
+ const array: Array<datatypes.WeightedBackend> = [];
500
581
  for await (const item of this._asyncList()) {
501
582
  array.push(item);
502
583
  }
@@ -504,9 +585,9 @@ export class EventStreams {
504
585
  }
505
586
  private _pagedList(
506
587
  arg: datatypes.Paging
507
- ): Promise<datatypes.EventStreamList> {
588
+ ): Promise<datatypes.WeightedBackendList> {
508
589
  return this.httpClient
509
- .url(`/event_streams`)
590
+ .url(`/backends/weighted`)
510
591
  .query(arg)
511
592
  .get()
512
593
  .json(payload => util.deserializeResult(payload))
@@ -520,7 +601,7 @@ export class EventStreams {
520
601
  while (nextPage) {
521
602
  const pagedList = await this._pagedList(page);
522
603
  nextPage = pagedList.nextPageUri;
523
- const items: datatypes.EventStream[] = pagedList.eventStreams;
604
+ const items: datatypes.WeightedBackend[] = pagedList.backends;
524
605
 
525
606
  if (nextPage) {
526
607
  page = {
@@ -535,66 +616,73 @@ export class EventStreams {
535
616
  }
536
617
  }
537
618
  /**
538
- * Update attributes of an Event Stream by ID.
619
+ * Update Weighted backend by ID
539
620
  */
540
621
  public update(
541
- arg: datatypes.EventStreamUpdate
542
- ): Promise<datatypes.EventStream> {
622
+ arg: datatypes.WeightedBackendUpdate
623
+ ): Promise<datatypes.WeightedBackend> {
543
624
  return this.httpClient
544
- .url(`/event_streams/${arg.id}`)
625
+ .url(`/backends/weighted/${arg.id}`)
545
626
  .patch(util.serializeArgument(arg))
546
627
  .json(payload => util.deserializeResult(payload))
547
628
  .then(f => f, util.onRejected);
548
629
  }
549
630
  }
550
631
 
551
- export class EventDestinations {
632
+ /**
633
+ * Certificate Authorities are x509 certificates that are used to sign other
634
+ x509 certificates. Attach a Certificate Authority to the Mutual TLS module
635
+ to verify that the TLS certificate presented by a client has been signed by
636
+ this CA. Certificate Authorities are used only for mTLS validation only and
637
+ thus a private key is not included in the resource.
638
+ */
639
+ export class CertificateAuthorities {
552
640
  private httpClient: Wretcher;
553
641
 
554
- /** Do not construct this object directly, use the <code>eventDestinations</code> property of an <code>Ngrok</code> client object instead. */
642
+ /** Do not construct this object directly, use the <code>certificateAuthorities</code> property of an <code>Ngrok</code> client object instead. */
555
643
  public constructor(httpClient: Wretcher) {
556
644
  this.httpClient = httpClient;
557
645
  }
558
646
  /**
559
- * Create a new Event Destination. It will not apply to anything until it is associated with an Event Stream, and that Event Stream is associated with an Endpoint Config.
647
+ * Upload a new Certificate Authority
560
648
  */
561
649
  public create(
562
- arg: datatypes.EventDestinationCreate
563
- ): Promise<datatypes.EventDestination> {
650
+ arg: datatypes.CertificateAuthorityCreate
651
+ ): Promise<datatypes.CertificateAuthority> {
564
652
  return this.httpClient
565
- .url(`/event_destinations`)
653
+ .url(`/certificate_authorities`)
566
654
  .post(util.serializeArgument(arg))
567
655
  .json(payload => util.deserializeResult(payload))
568
656
  .then(f => f, util.onRejected);
569
657
  }
570
658
 
571
659
  /**
572
- * Delete an Event Destination. If the Event Destination is still referenced by an Event Stream, this will throw an error until that Event Stream has removed that reference.
660
+ * Delete a Certificate Authority
573
661
  */
574
662
  public delete(arg: datatypes.Item): Promise<void> {
575
663
  return this.httpClient
576
- .url(`/event_destinations/${arg.id}`)
664
+ .url(`/certificate_authorities/${arg.id}`)
577
665
  .delete()
578
666
  .json(payload => util.deserializeResult(payload))
579
667
  .then(f => f, util.onRejected);
580
668
  }
581
669
 
582
670
  /**
583
- * Get detailed information about an Event Destination by ID.
671
+ * Get detailed information about a certficate authority
584
672
  */
585
- public get(arg: datatypes.Item): Promise<datatypes.EventDestination> {
673
+ public get(arg: datatypes.Item): Promise<datatypes.CertificateAuthority> {
586
674
  return this.httpClient
587
- .url(`/event_destinations/${arg.id}`)
675
+ .url(`/certificate_authorities/${arg.id}`)
588
676
  .get()
589
677
  .json(payload => util.deserializeResult(payload))
590
678
  .then(f => f, util.onRejected);
591
679
  }
592
680
 
593
681
  /**
594
- * List all Event Destinations on this account.
682
+ * List all Certificate Authority on this account
595
683
  */
596
- public async list(): Promise<Array<datatypes.EventDestination>> {
597
- const array: Array<datatypes.EventDestination> = [];
684
+ public async list(): Promise<Array<datatypes.CertificateAuthority>> {
685
+ const array: Array<datatypes.CertificateAuthority> = [];
598
686
  for await (const item of this._asyncList()) {
599
687
  array.push(item);
600
688
  }
@@ -602,9 +690,9 @@ export class EventDestinations {
602
690
  }
603
691
  private _pagedList(
604
692
  arg: datatypes.Paging
605
- ): Promise<datatypes.EventDestinationList> {
693
+ ): Promise<datatypes.CertificateAuthorityList> {
606
694
  return this.httpClient
607
- .url(`/event_destinations`)
695
+ .url(`/certificate_authorities`)
608
696
  .query(arg)
609
697
  .get()
610
698
  .json(payload => util.deserializeResult(payload))
@@ -618,7 +706,8 @@ export class EventDestinations {
618
706
  while (nextPage) {
619
707
  const pagedList = await this._pagedList(page);
620
708
  nextPage = pagedList.nextPageUri;
621
- const items: datatypes.EventDestination[] = pagedList.eventDestinations;
709
+ const items: datatypes.CertificateAuthority[] =
710
+ pagedList.certificateAuthorities;
622
711
 
623
712
  if (nextPage) {
624
713
  page = {
@@ -633,76 +722,80 @@ export class EventDestinations {
633
722
  }
634
723
  }
635
724
  /**
636
- * Update attributes of an Event Destination.
725
+ * Update attributes of a Certificate Authority by ID
637
726
  */
638
727
  public update(
639
- arg: datatypes.EventDestinationUpdate
640
- ): Promise<datatypes.EventDestination> {
728
+ arg: datatypes.CertificateAuthorityUpdate
729
+ ): Promise<datatypes.CertificateAuthority> {
641
730
  return this.httpClient
642
- .url(`/event_destinations/${arg.id}`)
731
+ .url(`/certificate_authorities/${arg.id}`)
643
732
  .patch(util.serializeArgument(arg))
644
733
  .json(payload => util.deserializeResult(payload))
645
734
  .then(f => f, util.onRejected);
646
735
  }
647
736
  }
648
737
 
649
- export class EventSubscriptions {
738
+ /**
739
+ * Tunnel Credentials are ngrok agent authtokens. They authorize the ngrok
740
+ agent to connect the ngrok service as your account. They are installed with
741
+ the `ngrok authtoken` command or by specifying it in the `ngrok.yml`
742
+ configuration file with the `authtoken` property.
743
+ */
744
+ export class Credentials {
650
745
  private httpClient: Wretcher;
651
746
 
652
- /** Do not construct this object directly, use the <code>eventSubscriptions</code> property of an <code>Ngrok</code> client object instead. */
747
+ /** Do not construct this object directly, use the <code>credentials</code> property of an <code>Ngrok</code> client object instead. */
653
748
  public constructor(httpClient: Wretcher) {
654
749
  this.httpClient = httpClient;
655
750
  }
656
751
  /**
657
- * Create an Event Subscription.
752
+ * Create a new tunnel authtoken credential. This authtoken credential can be used to start a new tunnel session. The response to this API call is the only time the generated token is available. If you need it for future use, you must save it securely yourself.
658
753
  */
659
754
  public create(
660
- arg: datatypes.EventSubscriptionCreate
661
- ): Promise<datatypes.EventSubscription> {
755
+ arg: datatypes.CredentialCreate
756
+ ): Promise<datatypes.Credential> {
662
757
  return this.httpClient
663
- .url(`/event_subscriptions`)
758
+ .url(`/credentials`)
664
759
  .post(util.serializeArgument(arg))
665
760
  .json(payload => util.deserializeResult(payload))
666
761
  .then(f => f, util.onRejected);
667
762
  }
668
763
 
669
764
  /**
670
- * Delete an Event Subscription.
765
+ * Delete a tunnel authtoken credential by ID
671
766
  */
672
767
  public delete(arg: datatypes.Item): Promise<void> {
673
768
  return this.httpClient
674
- .url(`/event_subscriptions/${arg.id}`)
769
+ .url(`/credentials/${arg.id}`)
675
770
  .delete()
676
771
  .json(payload => util.deserializeResult(payload))
677
772
  .then(f => f, util.onRejected);
678
773
  }
679
774
 
680
775
  /**
681
- * Get an Event Subscription by ID.
776
+ * Get detailed information about a tunnel authtoken credential
682
777
  */
683
- public get(arg: datatypes.Item): Promise<datatypes.EventSubscription> {
778
+ public get(arg: datatypes.Item): Promise<datatypes.Credential> {
684
779
  return this.httpClient
685
- .url(`/event_subscriptions/${arg.id}`)
780
+ .url(`/credentials/${arg.id}`)
686
781
  .get()
687
782
  .json(payload => util.deserializeResult(payload))
688
783
  .then(f => f, util.onRejected);
689
784
  }
690
785
 
691
786
  /**
692
- * List this Account's Event Subscriptions.
787
+ * List all tunnel authtoken credentials on this account
693
788
  */
694
- public async list(): Promise<Array<datatypes.EventSubscription>> {
695
- const array: Array<datatypes.EventSubscription> = [];
789
+ public async list(): Promise<Array<datatypes.Credential>> {
790
+ const array: Array<datatypes.Credential> = [];
696
791
  for await (const item of this._asyncList()) {
697
792
  array.push(item);
698
793
  }
699
794
  return array;
700
795
  }
701
- private _pagedList(
702
- arg: datatypes.Paging
703
- ): Promise<datatypes.EventSubscriptionList> {
796
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.CredentialList> {
704
797
  return this.httpClient
705
- .url(`/event_subscriptions`)
798
+ .url(`/credentials`)
706
799
  .query(arg)
707
800
  .get()
708
801
  .json(payload => util.deserializeResult(payload))
@@ -716,7 +809,7 @@ export class EventSubscriptions {
716
809
  while (nextPage) {
717
810
  const pagedList = await this._pagedList(page);
718
811
  nextPage = pagedList.nextPageUri;
719
- const items: datatypes.EventSubscription[] = pagedList.eventSubscriptions;
812
+ const items: datatypes.Credential[] = pagedList.credentials;
720
813
 
721
814
  if (nextPage) {
722
815
  page = {
@@ -731,147 +824,831 @@ export class EventSubscriptions {
731
824
  }
732
825
  }
733
826
  /**
734
- * Update an Event Subscription.
827
+ * Update attributes of an tunnel authtoken credential by ID
735
828
  */
736
829
  public update(
737
- arg: datatypes.EventSubscriptionUpdate
738
- ): Promise<datatypes.EventSubscription> {
830
+ arg: datatypes.CredentialUpdate
831
+ ): Promise<datatypes.Credential> {
739
832
  return this.httpClient
740
- .url(`/event_subscriptions/${arg.id}`)
833
+ .url(`/credentials/${arg.id}`)
741
834
  .patch(util.serializeArgument(arg))
742
835
  .json(payload => util.deserializeResult(payload))
743
836
  .then(f => f, util.onRejected);
744
837
  }
745
838
  }
746
839
 
747
- export class EventSources {
840
+ export class EdgesHTTPSRoutes {
748
841
  private httpClient: Wretcher;
749
842
 
750
- /** Do not construct this object directly, use the <code>eventSources</code> property of an <code>Ngrok</code> client object instead. */
843
+ /** Do not construct this object directly, use the <code>edgesHttpsRoutes</code> property of an <code>Ngrok</code> client object instead. */
751
844
  public constructor(httpClient: Wretcher) {
752
845
  this.httpClient = httpClient;
753
846
  }
754
847
  /**
755
- * Add an additional type for which this event subscription will trigger
848
+ * Create an HTTPS Edge Route
756
849
  */
757
850
  public create(
758
- arg: datatypes.EventSourceCreate
759
- ): Promise<datatypes.EventSource> {
851
+ arg: datatypes.HTTPSEdgeRouteCreate
852
+ ): Promise<datatypes.HTTPSEdgeRoute> {
760
853
  return this.httpClient
761
- .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
854
+ .url(`/edges/https/${arg.edgeId}/routes`)
762
855
  .post(util.serializeArgument(arg))
763
856
  .json(payload => util.deserializeResult(payload))
764
857
  .then(f => f, util.onRejected);
765
858
  }
766
859
 
767
860
  /**
768
- * Remove a type for which this event subscription will trigger
861
+ * Get an HTTPS Edge Route by ID
769
862
  */
770
- public delete(arg: datatypes.EventSourceItem): Promise<void> {
863
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.HTTPSEdgeRoute> {
771
864
  return this.httpClient
772
- .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
773
- .delete()
865
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}`)
866
+ .get()
774
867
  .json(payload => util.deserializeResult(payload))
775
868
  .then(f => f, util.onRejected);
776
869
  }
777
870
 
778
871
  /**
779
- * Get the details for a given type that triggers for the given event subscription
872
+ * Updates an HTTPS Edge Route by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
780
873
  */
781
- public get(arg: datatypes.EventSourceItem): Promise<datatypes.EventSource> {
874
+ public update(
875
+ arg: datatypes.HTTPSEdgeRouteUpdate
876
+ ): Promise<datatypes.HTTPSEdgeRoute> {
877
+ return this.httpClient
878
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}`)
879
+ .patch(util.serializeArgument(arg))
880
+ .json(payload => util.deserializeResult(payload))
881
+ .then(f => f, util.onRejected);
882
+ }
883
+
884
+ /**
885
+ * Delete an HTTPS Edge Route by ID
886
+ */
887
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
888
+ return this.httpClient
889
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}`)
890
+ .delete()
891
+ .json(payload => util.deserializeResult(payload))
892
+ .then(f => f, util.onRejected);
893
+ }
894
+ }
895
+
896
+ export class EdgesHTTPS {
897
+ private httpClient: Wretcher;
898
+
899
+ /** Do not construct this object directly, use the <code>edgesHttps</code> property of an <code>Ngrok</code> client object instead. */
900
+ public constructor(httpClient: Wretcher) {
901
+ this.httpClient = httpClient;
902
+ }
903
+ /**
904
+ * Create an HTTPS Edge
905
+ */
906
+ public create(arg: datatypes.HTTPSEdgeCreate): Promise<datatypes.HTTPSEdge> {
907
+ return this.httpClient
908
+ .url(`/edges/https`)
909
+ .post(util.serializeArgument(arg))
910
+ .json(payload => util.deserializeResult(payload))
911
+ .then(f => f, util.onRejected);
912
+ }
913
+
914
+ /**
915
+ * Get an HTTPS Edge by ID
916
+ */
917
+ public get(arg: datatypes.Item): Promise<datatypes.HTTPSEdge> {
918
+ return this.httpClient
919
+ .url(`/edges/https/${arg.id}`)
920
+ .get()
921
+ .json(payload => util.deserializeResult(payload))
922
+ .then(f => f, util.onRejected);
923
+ }
924
+
925
+ /**
926
+ * Returns a list of all HTTPS Edges on this account
927
+ */
928
+ public async list(): Promise<Array<datatypes.HTTPSEdge>> {
929
+ const array: Array<datatypes.HTTPSEdge> = [];
930
+ for await (const item of this._asyncList()) {
931
+ array.push(item);
932
+ }
933
+ return array;
934
+ }
935
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.HTTPSEdgeList> {
936
+ return this.httpClient
937
+ .url(`/edges/https`)
938
+ .query(arg)
939
+ .get()
940
+ .json(payload => util.deserializeResult(payload))
941
+ .then(util.onFulfilled, util.onRejected);
942
+ }
943
+ private async *_asyncList() {
944
+ const limit = '100';
945
+ let nextPage = 'initial loop';
946
+ let page: datatypes.Paging = { limit: limit };
947
+
948
+ while (nextPage) {
949
+ const pagedList = await this._pagedList(page);
950
+ nextPage = pagedList.nextPageUri;
951
+ const items: datatypes.HTTPSEdge[] = pagedList.httpsEdges;
952
+
953
+ if (nextPage) {
954
+ page = {
955
+ beforeId: items[items.length - 1].id,
956
+ limit: limit,
957
+ };
958
+ }
959
+
960
+ for (const item of items) {
961
+ yield item;
962
+ }
963
+ }
964
+ }
965
+ /**
966
+ * Updates an HTTPS Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
967
+ */
968
+ public update(arg: datatypes.HTTPSEdgeUpdate): Promise<datatypes.HTTPSEdge> {
969
+ return this.httpClient
970
+ .url(`/edges/https/${arg.id}`)
971
+ .patch(util.serializeArgument(arg))
972
+ .json(payload => util.deserializeResult(payload))
973
+ .then(f => f, util.onRejected);
974
+ }
975
+
976
+ /**
977
+ * Delete an HTTPS Edge by ID
978
+ */
979
+ public delete(arg: datatypes.Item): Promise<void> {
980
+ return this.httpClient
981
+ .url(`/edges/https/${arg.id}`)
982
+ .delete()
983
+ .json(payload => util.deserializeResult(payload))
984
+ .then(f => f, util.onRejected);
985
+ }
986
+ }
987
+
988
+ export class HTTPSEdgeMutualTLSModule {
989
+ private httpClient: Wretcher;
990
+
991
+ /** Do not construct this object directly, use the <code>httpsEdgeMutualTlsModule</code> property of an <code>Ngrok</code> client object instead. */
992
+ public constructor(httpClient: Wretcher) {
993
+ this.httpClient = httpClient;
994
+ }
995
+ public replace(
996
+ arg: datatypes.EdgeMutualTLSReplace
997
+ ): Promise<datatypes.EndpointMutualTLS> {
998
+ return this.httpClient
999
+ .url(`/edges/https/${arg.id}/mutual_tls`)
1000
+ .put(util.serializeArgument(arg))
1001
+ .json(payload => util.deserializeResult(payload))
1002
+ .then(f => f, util.onRejected);
1003
+ }
1004
+
1005
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointMutualTLS> {
1006
+ return this.httpClient
1007
+ .url(`/edges/https/${arg.id}/mutual_tls`)
1008
+ .get()
1009
+ .json(payload => util.deserializeResult(payload))
1010
+ .then(f => f, util.onRejected);
1011
+ }
1012
+
1013
+ public delete(arg: datatypes.Item): Promise<void> {
1014
+ return this.httpClient
1015
+ .url(`/edges/https/${arg.id}/mutual_tls`)
1016
+ .delete()
1017
+ .json(payload => util.deserializeResult(payload))
1018
+ .then(f => f, util.onRejected);
1019
+ }
1020
+ }
1021
+
1022
+ export class HTTPSEdgeTLSTerminationModule {
1023
+ private httpClient: Wretcher;
1024
+
1025
+ /** Do not construct this object directly, use the <code>httpsEdgeTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
1026
+ public constructor(httpClient: Wretcher) {
1027
+ this.httpClient = httpClient;
1028
+ }
1029
+ public replace(
1030
+ arg: datatypes.EdgeTLSTerminationAtEdgeReplace
1031
+ ): Promise<datatypes.EndpointTLSTermination> {
1032
+ return this.httpClient
1033
+ .url(`/edges/https/${arg.id}/tls_termination`)
1034
+ .put(util.serializeArgument(arg))
1035
+ .json(payload => util.deserializeResult(payload))
1036
+ .then(f => f, util.onRejected);
1037
+ }
1038
+
1039
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointTLSTermination> {
1040
+ return this.httpClient
1041
+ .url(`/edges/https/${arg.id}/tls_termination`)
1042
+ .get()
1043
+ .json(payload => util.deserializeResult(payload))
1044
+ .then(f => f, util.onRejected);
1045
+ }
1046
+
1047
+ public delete(arg: datatypes.Item): Promise<void> {
1048
+ return this.httpClient
1049
+ .url(`/edges/https/${arg.id}/tls_termination`)
1050
+ .delete()
1051
+ .json(payload => util.deserializeResult(payload))
1052
+ .then(f => f, util.onRejected);
1053
+ }
1054
+ }
1055
+
1056
+ export class EdgeRouteBackendModule {
1057
+ private httpClient: Wretcher;
1058
+
1059
+ /** Do not construct this object directly, use the <code>edgeRouteBackendModule</code> property of an <code>Ngrok</code> client object instead. */
1060
+ public constructor(httpClient: Wretcher) {
1061
+ this.httpClient = httpClient;
1062
+ }
1063
+ public replace(
1064
+ arg: datatypes.EdgeRouteBackendReplace
1065
+ ): Promise<datatypes.EndpointBackend> {
1066
+ return this.httpClient
1067
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
1068
+ .put(util.serializeArgument(arg))
1069
+ .json(payload => util.deserializeResult(payload))
1070
+ .then(f => f, util.onRejected);
1071
+ }
1072
+
1073
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointBackend> {
1074
+ return this.httpClient
1075
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
1076
+ .get()
1077
+ .json(payload => util.deserializeResult(payload))
1078
+ .then(f => f, util.onRejected);
1079
+ }
1080
+
1081
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1082
+ return this.httpClient
1083
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/backend`)
1084
+ .delete()
1085
+ .json(payload => util.deserializeResult(payload))
1086
+ .then(f => f, util.onRejected);
1087
+ }
1088
+ }
1089
+
1090
+ export class EdgeRouteIPRestrictionModule {
1091
+ private httpClient: Wretcher;
1092
+
1093
+ /** Do not construct this object directly, use the <code>edgeRouteIpRestrictionModule</code> property of an <code>Ngrok</code> client object instead. */
1094
+ public constructor(httpClient: Wretcher) {
1095
+ this.httpClient = httpClient;
1096
+ }
1097
+ public replace(
1098
+ arg: datatypes.EdgeRouteIPRestrictionReplace
1099
+ ): Promise<datatypes.EndpointIPPolicy> {
1100
+ return this.httpClient
1101
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
1102
+ .put(util.serializeArgument(arg))
1103
+ .json(payload => util.deserializeResult(payload))
1104
+ .then(f => f, util.onRejected);
1105
+ }
1106
+
1107
+ public get(
1108
+ arg: datatypes.EdgeRouteItem
1109
+ ): Promise<datatypes.EndpointIPPolicy> {
1110
+ return this.httpClient
1111
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
1112
+ .get()
1113
+ .json(payload => util.deserializeResult(payload))
1114
+ .then(f => f, util.onRejected);
1115
+ }
1116
+
1117
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1118
+ return this.httpClient
1119
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/ip_restriction`)
1120
+ .delete()
1121
+ .json(payload => util.deserializeResult(payload))
1122
+ .then(f => f, util.onRejected);
1123
+ }
1124
+ }
1125
+
1126
+ export class EdgeRouteRequestHeadersModule {
1127
+ private httpClient: Wretcher;
1128
+
1129
+ /** Do not construct this object directly, use the <code>edgeRouteRequestHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1130
+ public constructor(httpClient: Wretcher) {
1131
+ this.httpClient = httpClient;
1132
+ }
1133
+ public replace(
1134
+ arg: datatypes.EdgeRouteRequestHeadersReplace
1135
+ ): Promise<datatypes.EndpointRequestHeaders> {
1136
+ return this.httpClient
1137
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
1138
+ .put(util.serializeArgument(arg))
1139
+ .json(payload => util.deserializeResult(payload))
1140
+ .then(f => f, util.onRejected);
1141
+ }
1142
+
1143
+ public get(
1144
+ arg: datatypes.EdgeRouteItem
1145
+ ): Promise<datatypes.EndpointRequestHeaders> {
1146
+ return this.httpClient
1147
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
1148
+ .get()
1149
+ .json(payload => util.deserializeResult(payload))
1150
+ .then(f => f, util.onRejected);
1151
+ }
1152
+
1153
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1154
+ return this.httpClient
1155
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/request_headers`)
1156
+ .delete()
1157
+ .json(payload => util.deserializeResult(payload))
1158
+ .then(f => f, util.onRejected);
1159
+ }
1160
+ }
1161
+
1162
+ export class EdgeRouteResponseHeadersModule {
1163
+ private httpClient: Wretcher;
1164
+
1165
+ /** Do not construct this object directly, use the <code>edgeRouteResponseHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1166
+ public constructor(httpClient: Wretcher) {
1167
+ this.httpClient = httpClient;
1168
+ }
1169
+ public replace(
1170
+ arg: datatypes.EdgeRouteResponseHeadersReplace
1171
+ ): Promise<datatypes.EndpointResponseHeaders> {
1172
+ return this.httpClient
1173
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
1174
+ .put(util.serializeArgument(arg))
1175
+ .json(payload => util.deserializeResult(payload))
1176
+ .then(f => f, util.onRejected);
1177
+ }
1178
+
1179
+ public get(
1180
+ arg: datatypes.EdgeRouteItem
1181
+ ): Promise<datatypes.EndpointResponseHeaders> {
1182
+ return this.httpClient
1183
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
1184
+ .get()
1185
+ .json(payload => util.deserializeResult(payload))
1186
+ .then(f => f, util.onRejected);
1187
+ }
1188
+
1189
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1190
+ return this.httpClient
1191
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/response_headers`)
1192
+ .delete()
1193
+ .json(payload => util.deserializeResult(payload))
1194
+ .then(f => f, util.onRejected);
1195
+ }
1196
+ }
1197
+
1198
+ export class EdgeRouteCompressionModule {
1199
+ private httpClient: Wretcher;
1200
+
1201
+ /** Do not construct this object directly, use the <code>edgeRouteCompressionModule</code> property of an <code>Ngrok</code> client object instead. */
1202
+ public constructor(httpClient: Wretcher) {
1203
+ this.httpClient = httpClient;
1204
+ }
1205
+ public replace(
1206
+ arg: datatypes.EdgeRouteCompressionReplace
1207
+ ): Promise<datatypes.EndpointCompression> {
1208
+ return this.httpClient
1209
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
1210
+ .put(util.serializeArgument(arg))
1211
+ .json(payload => util.deserializeResult(payload))
1212
+ .then(f => f, util.onRejected);
1213
+ }
1214
+
1215
+ public get(
1216
+ arg: datatypes.EdgeRouteItem
1217
+ ): Promise<datatypes.EndpointCompression> {
1218
+ return this.httpClient
1219
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
1220
+ .get()
1221
+ .json(payload => util.deserializeResult(payload))
1222
+ .then(f => f, util.onRejected);
1223
+ }
1224
+
1225
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1226
+ return this.httpClient
1227
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/compression`)
1228
+ .delete()
1229
+ .json(payload => util.deserializeResult(payload))
1230
+ .then(f => f, util.onRejected);
1231
+ }
1232
+ }
1233
+
1234
+ export class EdgeRouteCircuitBreakerModule {
1235
+ private httpClient: Wretcher;
1236
+
1237
+ /** Do not construct this object directly, use the <code>edgeRouteCircuitBreakerModule</code> property of an <code>Ngrok</code> client object instead. */
1238
+ public constructor(httpClient: Wretcher) {
1239
+ this.httpClient = httpClient;
1240
+ }
1241
+ public replace(
1242
+ arg: datatypes.EdgeRouteCircuitBreakerReplace
1243
+ ): Promise<datatypes.EndpointCircuitBreaker> {
1244
+ return this.httpClient
1245
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
1246
+ .put(util.serializeArgument(arg))
1247
+ .json(payload => util.deserializeResult(payload))
1248
+ .then(f => f, util.onRejected);
1249
+ }
1250
+
1251
+ public get(
1252
+ arg: datatypes.EdgeRouteItem
1253
+ ): Promise<datatypes.EndpointCircuitBreaker> {
1254
+ return this.httpClient
1255
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
1256
+ .get()
1257
+ .json(payload => util.deserializeResult(payload))
1258
+ .then(f => f, util.onRejected);
1259
+ }
1260
+
1261
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1262
+ return this.httpClient
1263
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/circuit_breaker`)
1264
+ .delete()
1265
+ .json(payload => util.deserializeResult(payload))
1266
+ .then(f => f, util.onRejected);
1267
+ }
1268
+ }
1269
+
1270
+ export class EdgeRouteWebhookVerificationModule {
1271
+ private httpClient: Wretcher;
1272
+
1273
+ /** Do not construct this object directly, use the <code>edgeRouteWebhookVerificationModule</code> property of an <code>Ngrok</code> client object instead. */
1274
+ public constructor(httpClient: Wretcher) {
1275
+ this.httpClient = httpClient;
1276
+ }
1277
+ public replace(
1278
+ arg: datatypes.EdgeRouteWebhookVerificationReplace
1279
+ ): Promise<datatypes.EndpointWebhookValidation> {
1280
+ return this.httpClient
1281
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
1282
+ .put(util.serializeArgument(arg))
1283
+ .json(payload => util.deserializeResult(payload))
1284
+ .then(f => f, util.onRejected);
1285
+ }
1286
+
1287
+ public get(
1288
+ arg: datatypes.EdgeRouteItem
1289
+ ): Promise<datatypes.EndpointWebhookValidation> {
1290
+ return this.httpClient
1291
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
1292
+ .get()
1293
+ .json(payload => util.deserializeResult(payload))
1294
+ .then(f => f, util.onRejected);
1295
+ }
1296
+
1297
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1298
+ return this.httpClient
1299
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/webhook_verification`)
1300
+ .delete()
1301
+ .json(payload => util.deserializeResult(payload))
1302
+ .then(f => f, util.onRejected);
1303
+ }
1304
+ }
1305
+
1306
+ export class EdgeRouteOAuthModule {
1307
+ private httpClient: Wretcher;
1308
+
1309
+ /** Do not construct this object directly, use the <code>edgeRouteOAuthModule</code> property of an <code>Ngrok</code> client object instead. */
1310
+ public constructor(httpClient: Wretcher) {
1311
+ this.httpClient = httpClient;
1312
+ }
1313
+ public replace(
1314
+ arg: datatypes.EdgeRouteOAuthReplace
1315
+ ): Promise<datatypes.EndpointOAuth> {
1316
+ return this.httpClient
1317
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
1318
+ .put(util.serializeArgument(arg))
1319
+ .json(payload => util.deserializeResult(payload))
1320
+ .then(f => f, util.onRejected);
1321
+ }
1322
+
1323
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointOAuth> {
1324
+ return this.httpClient
1325
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
1326
+ .get()
1327
+ .json(payload => util.deserializeResult(payload))
1328
+ .then(f => f, util.onRejected);
1329
+ }
1330
+
1331
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1332
+ return this.httpClient
1333
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oauth`)
1334
+ .delete()
1335
+ .json(payload => util.deserializeResult(payload))
1336
+ .then(f => f, util.onRejected);
1337
+ }
1338
+ }
1339
+
1340
+ export class EdgeRouteSAMLModule {
1341
+ private httpClient: Wretcher;
1342
+
1343
+ /** Do not construct this object directly, use the <code>edgeRouteSamlModule</code> property of an <code>Ngrok</code> client object instead. */
1344
+ public constructor(httpClient: Wretcher) {
1345
+ this.httpClient = httpClient;
1346
+ }
1347
+ public replace(
1348
+ arg: datatypes.EdgeRouteSAMLReplace
1349
+ ): Promise<datatypes.EndpointSAML> {
1350
+ return this.httpClient
1351
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
1352
+ .put(util.serializeArgument(arg))
1353
+ .json(payload => util.deserializeResult(payload))
1354
+ .then(f => f, util.onRejected);
1355
+ }
1356
+
1357
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointSAML> {
1358
+ return this.httpClient
1359
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
1360
+ .get()
1361
+ .json(payload => util.deserializeResult(payload))
1362
+ .then(f => f, util.onRejected);
1363
+ }
1364
+
1365
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1366
+ return this.httpClient
1367
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/saml`)
1368
+ .delete()
1369
+ .json(payload => util.deserializeResult(payload))
1370
+ .then(f => f, util.onRejected);
1371
+ }
1372
+ }
1373
+
1374
+ export class EdgeRouteOIDCModule {
1375
+ private httpClient: Wretcher;
1376
+
1377
+ /** Do not construct this object directly, use the <code>edgeRouteOidcModule</code> property of an <code>Ngrok</code> client object instead. */
1378
+ public constructor(httpClient: Wretcher) {
1379
+ this.httpClient = httpClient;
1380
+ }
1381
+ public replace(
1382
+ arg: datatypes.EdgeRouteOIDCReplace
1383
+ ): Promise<datatypes.EndpointOIDC> {
1384
+ return this.httpClient
1385
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
1386
+ .put(util.serializeArgument(arg))
1387
+ .json(payload => util.deserializeResult(payload))
1388
+ .then(f => f, util.onRejected);
1389
+ }
1390
+
1391
+ public get(arg: datatypes.EdgeRouteItem): Promise<datatypes.EndpointOIDC> {
1392
+ return this.httpClient
1393
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
1394
+ .get()
1395
+ .json(payload => util.deserializeResult(payload))
1396
+ .then(f => f, util.onRejected);
1397
+ }
1398
+
1399
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1400
+ return this.httpClient
1401
+ .url(`/edges/https/${arg.edgeId}/routes/${arg.id}/oidc`)
1402
+ .delete()
1403
+ .json(payload => util.deserializeResult(payload))
1404
+ .then(f => f, util.onRejected);
1405
+ }
1406
+ }
1407
+
1408
+ export class EdgeRouteWebsocketTCPConverterModule {
1409
+ private httpClient: Wretcher;
1410
+
1411
+ /** Do not construct this object directly, use the <code>edgeRouteWebsocketTcpConverterModule</code> property of an <code>Ngrok</code> client object instead. */
1412
+ public constructor(httpClient: Wretcher) {
1413
+ this.httpClient = httpClient;
1414
+ }
1415
+ public replace(
1416
+ arg: datatypes.EdgeRouteWebsocketTCPConverterReplace
1417
+ ): Promise<datatypes.EndpointWebsocketTCPConverter> {
1418
+ return this.httpClient
1419
+ .url(
1420
+ `/edges/https/${arg.edgeId}/routes/${arg.id}/websocket_tcp_converter`
1421
+ )
1422
+ .put(util.serializeArgument(arg))
1423
+ .json(payload => util.deserializeResult(payload))
1424
+ .then(f => f, util.onRejected);
1425
+ }
1426
+
1427
+ public get(
1428
+ arg: datatypes.EdgeRouteItem
1429
+ ): Promise<datatypes.EndpointWebsocketTCPConverter> {
1430
+ return this.httpClient
1431
+ .url(
1432
+ `/edges/https/${arg.edgeId}/routes/${arg.id}/websocket_tcp_converter`
1433
+ )
1434
+ .get()
1435
+ .json(payload => util.deserializeResult(payload))
1436
+ .then(f => f, util.onRejected);
1437
+ }
1438
+
1439
+ public delete(arg: datatypes.EdgeRouteItem): Promise<void> {
1440
+ return this.httpClient
1441
+ .url(
1442
+ `/edges/https/${arg.edgeId}/routes/${arg.id}/websocket_tcp_converter`
1443
+ )
1444
+ .delete()
1445
+ .json(payload => util.deserializeResult(payload))
1446
+ .then(f => f, util.onRejected);
1447
+ }
1448
+ }
1449
+
1450
+ export class EdgesTCP {
1451
+ private httpClient: Wretcher;
1452
+
1453
+ /** Do not construct this object directly, use the <code>edgesTcp</code> property of an <code>Ngrok</code> client object instead. */
1454
+ public constructor(httpClient: Wretcher) {
1455
+ this.httpClient = httpClient;
1456
+ }
1457
+ /**
1458
+ * Create a TCP Edge
1459
+ */
1460
+ public create(arg: datatypes.TCPEdgeCreate): Promise<datatypes.TCPEdge> {
1461
+ return this.httpClient
1462
+ .url(`/edges/tcp`)
1463
+ .post(util.serializeArgument(arg))
1464
+ .json(payload => util.deserializeResult(payload))
1465
+ .then(f => f, util.onRejected);
1466
+ }
1467
+
1468
+ /**
1469
+ * Get a TCP Edge by ID
1470
+ */
1471
+ public get(arg: datatypes.Item): Promise<datatypes.TCPEdge> {
1472
+ return this.httpClient
1473
+ .url(`/edges/tcp/${arg.id}`)
1474
+ .get()
1475
+ .json(payload => util.deserializeResult(payload))
1476
+ .then(f => f, util.onRejected);
1477
+ }
1478
+
1479
+ /**
1480
+ * Returns a list of all TCP Edges on this account
1481
+ */
1482
+ public async list(): Promise<Array<datatypes.TCPEdge>> {
1483
+ const array: Array<datatypes.TCPEdge> = [];
1484
+ for await (const item of this._asyncList()) {
1485
+ array.push(item);
1486
+ }
1487
+ return array;
1488
+ }
1489
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.TCPEdgeList> {
1490
+ return this.httpClient
1491
+ .url(`/edges/tcp`)
1492
+ .query(arg)
1493
+ .get()
1494
+ .json(payload => util.deserializeResult(payload))
1495
+ .then(util.onFulfilled, util.onRejected);
1496
+ }
1497
+ private async *_asyncList() {
1498
+ const limit = '100';
1499
+ let nextPage = 'initial loop';
1500
+ let page: datatypes.Paging = { limit: limit };
1501
+
1502
+ while (nextPage) {
1503
+ const pagedList = await this._pagedList(page);
1504
+ nextPage = pagedList.nextPageUri;
1505
+ const items: datatypes.TCPEdge[] = pagedList.tcpEdges;
1506
+
1507
+ if (nextPage) {
1508
+ page = {
1509
+ beforeId: items[items.length - 1].id,
1510
+ limit: limit,
1511
+ };
1512
+ }
1513
+
1514
+ for (const item of items) {
1515
+ yield item;
1516
+ }
1517
+ }
1518
+ }
1519
+ /**
1520
+ * Updates a TCP Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
1521
+ */
1522
+ public update(arg: datatypes.TCPEdgeUpdate): Promise<datatypes.TCPEdge> {
782
1523
  return this.httpClient
783
- .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
784
- .get()
1524
+ .url(`/edges/tcp/${arg.id}`)
1525
+ .patch(util.serializeArgument(arg))
785
1526
  .json(payload => util.deserializeResult(payload))
786
1527
  .then(f => f, util.onRejected);
787
1528
  }
788
1529
 
789
1530
  /**
790
- * List the types for which this event subscription will trigger
1531
+ * Delete a TCP Edge by ID
791
1532
  */
792
- public list(
793
- arg: datatypes.EventSourcePaging
794
- ): Promise<datatypes.EventSourceList> {
1533
+ public delete(arg: datatypes.Item): Promise<void> {
795
1534
  return this.httpClient
796
- .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
1535
+ .url(`/edges/tcp/${arg.id}`)
1536
+ .delete()
1537
+ .json(payload => util.deserializeResult(payload))
1538
+ .then(f => f, util.onRejected);
1539
+ }
1540
+ }
1541
+
1542
+ export class TCPEdgeBackendModule {
1543
+ private httpClient: Wretcher;
1544
+
1545
+ /** Do not construct this object directly, use the <code>tcpEdgeBackendModule</code> property of an <code>Ngrok</code> client object instead. */
1546
+ public constructor(httpClient: Wretcher) {
1547
+ this.httpClient = httpClient;
1548
+ }
1549
+ public replace(
1550
+ arg: datatypes.EdgeBackendReplace
1551
+ ): Promise<datatypes.EndpointBackend> {
1552
+ return this.httpClient
1553
+ .url(`/edges/tcp/${arg.id}/backend`)
1554
+ .put(util.serializeArgument(arg))
1555
+ .json(payload => util.deserializeResult(payload))
1556
+ .then(f => f, util.onRejected);
1557
+ }
1558
+
1559
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointBackend> {
1560
+ return this.httpClient
1561
+ .url(`/edges/tcp/${arg.id}/backend`)
797
1562
  .get()
798
1563
  .json(payload => util.deserializeResult(payload))
799
1564
  .then(f => f, util.onRejected);
800
1565
  }
801
1566
 
802
- /**
803
- * Update the type for which this event subscription will trigger
804
- */
805
- public update(
806
- arg: datatypes.EventSourceUpdate
807
- ): Promise<datatypes.EventSource> {
1567
+ public delete(arg: datatypes.Item): Promise<void> {
808
1568
  return this.httpClient
809
- .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
810
- .patch(util.serializeArgument(arg))
1569
+ .url(`/edges/tcp/${arg.id}/backend`)
1570
+ .delete()
811
1571
  .json(payload => util.deserializeResult(payload))
812
1572
  .then(f => f, util.onRejected);
813
1573
  }
814
1574
  }
815
1575
 
816
- /**
817
- * IP Policies are reusable groups of CIDR ranges with an `allow` or `deny`
818
- action. They can be attached to endpoints via the Endpoint Configuration IP
819
- Policy module. They can also be used with IP Restrictions to control source
820
- IP ranges that can start tunnel sessions and connect to the API and dashboard.
821
- */
822
- export class IPPolicies {
1576
+ export class TCPEdgeIPRestrictionModule {
823
1577
  private httpClient: Wretcher;
824
1578
 
825
- /** Do not construct this object directly, use the <code>ipPolicies</code> property of an <code>Ngrok</code> client object instead. */
1579
+ /** Do not construct this object directly, use the <code>tcpEdgeIpRestrictionModule</code> property of an <code>Ngrok</code> client object instead. */
826
1580
  public constructor(httpClient: Wretcher) {
827
1581
  this.httpClient = httpClient;
828
1582
  }
829
- /**
830
- * Create a new IP policy. It will not apply to any traffic until you associate to a traffic source via an endpoint configuration or IP restriction.
831
- */
832
- public create(arg: datatypes.IPPolicyCreate): Promise<datatypes.IPPolicy> {
1583
+ public replace(
1584
+ arg: datatypes.EdgeIPRestrictionReplace
1585
+ ): Promise<datatypes.EndpointIPPolicy> {
833
1586
  return this.httpClient
834
- .url(`/ip_policies`)
835
- .post(util.serializeArgument(arg))
1587
+ .url(`/edges/tcp/${arg.id}/ip_restriction`)
1588
+ .put(util.serializeArgument(arg))
1589
+ .json(payload => util.deserializeResult(payload))
1590
+ .then(f => f, util.onRejected);
1591
+ }
1592
+
1593
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointIPPolicy> {
1594
+ return this.httpClient
1595
+ .url(`/edges/tcp/${arg.id}/ip_restriction`)
1596
+ .get()
836
1597
  .json(payload => util.deserializeResult(payload))
837
1598
  .then(f => f, util.onRejected);
838
1599
  }
839
1600
 
840
- /**
841
- * Delete an IP policy. If the IP policy is referenced by another object for the purposes of traffic restriction it will be treated as if the IP policy remains but has zero rules.
842
- */
843
1601
  public delete(arg: datatypes.Item): Promise<void> {
844
1602
  return this.httpClient
845
- .url(`/ip_policies/${arg.id}`)
1603
+ .url(`/edges/tcp/${arg.id}/ip_restriction`)
846
1604
  .delete()
847
1605
  .json(payload => util.deserializeResult(payload))
848
1606
  .then(f => f, util.onRejected);
849
1607
  }
1608
+ }
850
1609
 
1610
+ export class EdgesTLS {
1611
+ private httpClient: Wretcher;
1612
+
1613
+ /** Do not construct this object directly, use the <code>edgesTls</code> property of an <code>Ngrok</code> client object instead. */
1614
+ public constructor(httpClient: Wretcher) {
1615
+ this.httpClient = httpClient;
1616
+ }
851
1617
  /**
852
- * Get detailed information about an IP policy by ID.
1618
+ * Create a TLS Edge
853
1619
  */
854
- public get(arg: datatypes.Item): Promise<datatypes.IPPolicy> {
1620
+ public create(arg: datatypes.TLSEdgeCreate): Promise<datatypes.TLSEdge> {
855
1621
  return this.httpClient
856
- .url(`/ip_policies/${arg.id}`)
1622
+ .url(`/edges/tls`)
1623
+ .post(util.serializeArgument(arg))
1624
+ .json(payload => util.deserializeResult(payload))
1625
+ .then(f => f, util.onRejected);
1626
+ }
1627
+
1628
+ /**
1629
+ * Get a TLS Edge by ID
1630
+ */
1631
+ public get(arg: datatypes.Item): Promise<datatypes.TLSEdge> {
1632
+ return this.httpClient
1633
+ .url(`/edges/tls/${arg.id}`)
857
1634
  .get()
858
1635
  .json(payload => util.deserializeResult(payload))
859
1636
  .then(f => f, util.onRejected);
860
1637
  }
861
1638
 
862
1639
  /**
863
- * List all IP policies on this account
1640
+ * Returns a list of all TLS Edges on this account
864
1641
  */
865
- public async list(): Promise<Array<datatypes.IPPolicy>> {
866
- const array: Array<datatypes.IPPolicy> = [];
1642
+ public async list(): Promise<Array<datatypes.TLSEdge>> {
1643
+ const array: Array<datatypes.TLSEdge> = [];
867
1644
  for await (const item of this._asyncList()) {
868
1645
  array.push(item);
869
1646
  }
870
1647
  return array;
871
1648
  }
872
- private _pagedList(arg: datatypes.Paging): Promise<datatypes.IPPolicyList> {
1649
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.TLSEdgeList> {
873
1650
  return this.httpClient
874
- .url(`/ip_policies`)
1651
+ .url(`/edges/tls`)
875
1652
  .query(arg)
876
1653
  .get()
877
1654
  .json(payload => util.deserializeResult(payload))
@@ -885,7 +1662,7 @@ export class IPPolicies {
885
1662
  while (nextPage) {
886
1663
  const pagedList = await this._pagedList(page);
887
1664
  nextPage = pagedList.nextPageUri;
888
- const items: datatypes.IPPolicy[] = pagedList.ipPolicies;
1665
+ const items: datatypes.TLSEdge[] = pagedList.tlsEdges;
889
1666
 
890
1667
  if (nextPage) {
891
1668
  page = {
@@ -900,78 +1677,189 @@ export class IPPolicies {
900
1677
  }
901
1678
  }
902
1679
  /**
903
- * Update attributes of an IP policy by ID
1680
+ * Updates a TLS Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
904
1681
  */
905
- public update(arg: datatypes.IPPolicyUpdate): Promise<datatypes.IPPolicy> {
1682
+ public update(arg: datatypes.TLSEdgeUpdate): Promise<datatypes.TLSEdge> {
906
1683
  return this.httpClient
907
- .url(`/ip_policies/${arg.id}`)
1684
+ .url(`/edges/tls/${arg.id}`)
908
1685
  .patch(util.serializeArgument(arg))
909
1686
  .json(payload => util.deserializeResult(payload))
910
1687
  .then(f => f, util.onRejected);
911
1688
  }
1689
+
1690
+ /**
1691
+ * Delete a TLS Edge by ID
1692
+ */
1693
+ public delete(arg: datatypes.Item): Promise<void> {
1694
+ return this.httpClient
1695
+ .url(`/edges/tls/${arg.id}`)
1696
+ .delete()
1697
+ .json(payload => util.deserializeResult(payload))
1698
+ .then(f => f, util.onRejected);
1699
+ }
912
1700
  }
913
1701
 
914
- /**
915
- * IP Policy Rules are the IPv4 or IPv6 CIDRs entries that
916
- make up an IP Policy.
917
- */
918
- export class IPPolicyRules {
1702
+ export class TLSEdgeBackendModule {
919
1703
  private httpClient: Wretcher;
920
1704
 
921
- /** Do not construct this object directly, use the <code>ipPolicyRules</code> property of an <code>Ngrok</code> client object instead. */
1705
+ /** Do not construct this object directly, use the <code>tlsEdgeBackendModule</code> property of an <code>Ngrok</code> client object instead. */
922
1706
  public constructor(httpClient: Wretcher) {
923
1707
  this.httpClient = httpClient;
924
1708
  }
925
- /**
926
- * Create a new IP policy rule attached to an IP Policy.
927
- */
928
- public create(
929
- arg: datatypes.IPPolicyRuleCreate
930
- ): Promise<datatypes.IPPolicyRule> {
1709
+ public replace(
1710
+ arg: datatypes.EdgeBackendReplace
1711
+ ): Promise<datatypes.EndpointBackend> {
931
1712
  return this.httpClient
932
- .url(`/ip_policy_rules`)
933
- .post(util.serializeArgument(arg))
1713
+ .url(`/edges/tls/${arg.id}/backend`)
1714
+ .put(util.serializeArgument(arg))
1715
+ .json(payload => util.deserializeResult(payload))
1716
+ .then(f => f, util.onRejected);
1717
+ }
1718
+
1719
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointBackend> {
1720
+ return this.httpClient
1721
+ .url(`/edges/tls/${arg.id}/backend`)
1722
+ .get()
934
1723
  .json(payload => util.deserializeResult(payload))
935
1724
  .then(f => f, util.onRejected);
936
1725
  }
937
1726
 
938
- /**
939
- * Delete an IP policy rule.
940
- */
941
1727
  public delete(arg: datatypes.Item): Promise<void> {
942
1728
  return this.httpClient
943
- .url(`/ip_policy_rules/${arg.id}`)
1729
+ .url(`/edges/tls/${arg.id}/backend`)
944
1730
  .delete()
945
1731
  .json(payload => util.deserializeResult(payload))
946
1732
  .then(f => f, util.onRejected);
947
1733
  }
1734
+ }
948
1735
 
949
- /**
950
- * Get detailed information about an IP policy rule by ID.
951
- */
952
- public get(arg: datatypes.Item): Promise<datatypes.IPPolicyRule> {
1736
+ export class TLSEdgeIPRestrictionModule {
1737
+ private httpClient: Wretcher;
1738
+
1739
+ /** Do not construct this object directly, use the <code>tlsEdgeIpRestrictionModule</code> property of an <code>Ngrok</code> client object instead. */
1740
+ public constructor(httpClient: Wretcher) {
1741
+ this.httpClient = httpClient;
1742
+ }
1743
+ public replace(
1744
+ arg: datatypes.EdgeIPRestrictionReplace
1745
+ ): Promise<datatypes.EndpointIPPolicy> {
953
1746
  return this.httpClient
954
- .url(`/ip_policy_rules/${arg.id}`)
1747
+ .url(`/edges/tls/${arg.id}/ip_restriction`)
1748
+ .put(util.serializeArgument(arg))
1749
+ .json(payload => util.deserializeResult(payload))
1750
+ .then(f => f, util.onRejected);
1751
+ }
1752
+
1753
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointIPPolicy> {
1754
+ return this.httpClient
1755
+ .url(`/edges/tls/${arg.id}/ip_restriction`)
1756
+ .get()
1757
+ .json(payload => util.deserializeResult(payload))
1758
+ .then(f => f, util.onRejected);
1759
+ }
1760
+
1761
+ public delete(arg: datatypes.Item): Promise<void> {
1762
+ return this.httpClient
1763
+ .url(`/edges/tls/${arg.id}/ip_restriction`)
1764
+ .delete()
1765
+ .json(payload => util.deserializeResult(payload))
1766
+ .then(f => f, util.onRejected);
1767
+ }
1768
+ }
1769
+
1770
+ export class TLSEdgeMutualTLSModule {
1771
+ private httpClient: Wretcher;
1772
+
1773
+ /** Do not construct this object directly, use the <code>tlsEdgeMutualTlsModule</code> property of an <code>Ngrok</code> client object instead. */
1774
+ public constructor(httpClient: Wretcher) {
1775
+ this.httpClient = httpClient;
1776
+ }
1777
+ public replace(
1778
+ arg: datatypes.EdgeMutualTLSReplace
1779
+ ): Promise<datatypes.EndpointMutualTLS> {
1780
+ return this.httpClient
1781
+ .url(`/edges/tls/${arg.id}/mutual_tls`)
1782
+ .put(util.serializeArgument(arg))
1783
+ .json(payload => util.deserializeResult(payload))
1784
+ .then(f => f, util.onRejected);
1785
+ }
1786
+
1787
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointMutualTLS> {
1788
+ return this.httpClient
1789
+ .url(`/edges/tls/${arg.id}/mutual_tls`)
1790
+ .get()
1791
+ .json(payload => util.deserializeResult(payload))
1792
+ .then(f => f, util.onRejected);
1793
+ }
1794
+
1795
+ public delete(arg: datatypes.Item): Promise<void> {
1796
+ return this.httpClient
1797
+ .url(`/edges/tls/${arg.id}/mutual_tls`)
1798
+ .delete()
1799
+ .json(payload => util.deserializeResult(payload))
1800
+ .then(f => f, util.onRejected);
1801
+ }
1802
+ }
1803
+
1804
+ export class TLSEdgeTLSTerminationModule {
1805
+ private httpClient: Wretcher;
1806
+
1807
+ /** Do not construct this object directly, use the <code>tlsEdgeTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
1808
+ public constructor(httpClient: Wretcher) {
1809
+ this.httpClient = httpClient;
1810
+ }
1811
+ public replace(
1812
+ arg: datatypes.EdgeTLSTerminationReplace
1813
+ ): Promise<datatypes.EndpointTLSTermination> {
1814
+ return this.httpClient
1815
+ .url(`/edges/tls/${arg.id}/tls_termination`)
1816
+ .put(util.serializeArgument(arg))
1817
+ .json(payload => util.deserializeResult(payload))
1818
+ .then(f => f, util.onRejected);
1819
+ }
1820
+
1821
+ public get(arg: datatypes.Item): Promise<datatypes.EndpointTLSTermination> {
1822
+ return this.httpClient
1823
+ .url(`/edges/tls/${arg.id}/tls_termination`)
955
1824
  .get()
956
1825
  .json(payload => util.deserializeResult(payload))
957
1826
  .then(f => f, util.onRejected);
958
1827
  }
959
1828
 
1829
+ public delete(arg: datatypes.Item): Promise<void> {
1830
+ return this.httpClient
1831
+ .url(`/edges/tls/${arg.id}/tls_termination`)
1832
+ .delete()
1833
+ .json(payload => util.deserializeResult(payload))
1834
+ .then(f => f, util.onRejected);
1835
+ }
1836
+ }
1837
+
1838
+ /**
1839
+ * Endpoints provides an API for querying the endpoint objects
1840
+ which define what tunnel or edge is used to serve a hostport.
1841
+ Only active endpoints associated with a tunnel or backend are returned.
1842
+ */
1843
+ export class Endpoints {
1844
+ private httpClient: Wretcher;
1845
+
1846
+ /** Do not construct this object directly, use the <code>endpoints</code> property of an <code>Ngrok</code> client object instead. */
1847
+ public constructor(httpClient: Wretcher) {
1848
+ this.httpClient = httpClient;
1849
+ }
960
1850
  /**
961
- * List all IP policy rules on this account
1851
+ * List all active endpoints on the account
962
1852
  */
963
- public async list(): Promise<Array<datatypes.IPPolicyRule>> {
964
- const array: Array<datatypes.IPPolicyRule> = [];
1853
+ public async list(): Promise<Array<datatypes.Endpoint>> {
1854
+ const array: Array<datatypes.Endpoint> = [];
965
1855
  for await (const item of this._asyncList()) {
966
1856
  array.push(item);
967
1857
  }
968
1858
  return array;
969
1859
  }
970
- private _pagedList(
971
- arg: datatypes.Paging
972
- ): Promise<datatypes.IPPolicyRuleList> {
1860
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.EndpointList> {
973
1861
  return this.httpClient
974
- .url(`/ip_policy_rules`)
1862
+ .url(`/endpoints`)
975
1863
  .query(arg)
976
1864
  .get()
977
1865
  .json(payload => util.deserializeResult(payload))
@@ -985,7 +1873,7 @@ export class IPPolicyRules {
985
1873
  while (nextPage) {
986
1874
  const pagedList = await this._pagedList(page);
987
1875
  nextPage = pagedList.nextPageUri;
988
- const items: datatypes.IPPolicyRule[] = pagedList.ipPolicyRules;
1876
+ const items: datatypes.Endpoint[] = pagedList.endpoints;
989
1877
 
990
1878
  if (nextPage) {
991
1879
  page = {
@@ -1000,74 +1888,64 @@ export class IPPolicyRules {
1000
1888
  }
1001
1889
  }
1002
1890
  /**
1003
- * Update attributes of an IP policy rule by ID
1891
+ * Get the status of an endpoint by ID
1004
1892
  */
1005
- public update(
1006
- arg: datatypes.IPPolicyRuleUpdate
1007
- ): Promise<datatypes.IPPolicyRule> {
1893
+ public get(arg: datatypes.Item): Promise<datatypes.Endpoint> {
1008
1894
  return this.httpClient
1009
- .url(`/ip_policy_rules/${arg.id}`)
1010
- .patch(util.serializeArgument(arg))
1895
+ .url(`/endpoints/${arg.id}`)
1896
+ .get()
1011
1897
  .json(payload => util.deserializeResult(payload))
1012
1898
  .then(f => f, util.onRejected);
1013
1899
  }
1014
1900
  }
1015
1901
 
1016
- /**
1017
- * An IP restriction is a restriction placed on the CIDRs that are allowed to
1018
- initate traffic to a specific aspect of your ngrok account. An IP
1019
- restriction has a type which defines the ingress it applies to. IP
1020
- restrictions can be used to enforce the source IPs that can make API
1021
- requests, log in to the dashboard, start ngrok agents, and connect to your
1022
- public-facing endpoints.
1023
- */
1024
- export class IPRestrictions {
1902
+ export class EventDestinations {
1025
1903
  private httpClient: Wretcher;
1026
1904
 
1027
- /** Do not construct this object directly, use the <code>ipRestrictions</code> property of an <code>Ngrok</code> client object instead. */
1905
+ /** Do not construct this object directly, use the <code>eventDestinations</code> property of an <code>Ngrok</code> client object instead. */
1028
1906
  public constructor(httpClient: Wretcher) {
1029
1907
  this.httpClient = httpClient;
1030
1908
  }
1031
1909
  /**
1032
- * Create a new IP restriction
1910
+ * Create a new Event Destination. It will not apply to anything until it is associated with an Event Stream, and that Event Stream is associated with an Endpoint Config.
1033
1911
  */
1034
1912
  public create(
1035
- arg: datatypes.IPRestrictionCreate
1036
- ): Promise<datatypes.IPRestriction> {
1913
+ arg: datatypes.EventDestinationCreate
1914
+ ): Promise<datatypes.EventDestination> {
1037
1915
  return this.httpClient
1038
- .url(`/ip_restrictions`)
1916
+ .url(`/event_destinations`)
1039
1917
  .post(util.serializeArgument(arg))
1040
1918
  .json(payload => util.deserializeResult(payload))
1041
1919
  .then(f => f, util.onRejected);
1042
1920
  }
1043
1921
 
1044
1922
  /**
1045
- * Delete an IP restriction
1923
+ * Delete an Event Destination. If the Event Destination is still referenced by an Event Subscription.
1046
1924
  */
1047
1925
  public delete(arg: datatypes.Item): Promise<void> {
1048
1926
  return this.httpClient
1049
- .url(`/ip_restrictions/${arg.id}`)
1927
+ .url(`/event_destinations/${arg.id}`)
1050
1928
  .delete()
1051
1929
  .json(payload => util.deserializeResult(payload))
1052
1930
  .then(f => f, util.onRejected);
1053
1931
  }
1054
1932
 
1055
1933
  /**
1056
- * Get detailed information about an IP restriction
1934
+ * Get detailed information about an Event Destination by ID.
1057
1935
  */
1058
- public get(arg: datatypes.Item): Promise<datatypes.IPRestriction> {
1936
+ public get(arg: datatypes.Item): Promise<datatypes.EventDestination> {
1059
1937
  return this.httpClient
1060
- .url(`/ip_restrictions/${arg.id}`)
1938
+ .url(`/event_destinations/${arg.id}`)
1061
1939
  .get()
1062
1940
  .json(payload => util.deserializeResult(payload))
1063
1941
  .then(f => f, util.onRejected);
1064
1942
  }
1065
1943
 
1066
1944
  /**
1067
- * List all IP restrictions on this account
1945
+ * List all Event Destinations on this account.
1068
1946
  */
1069
- public async list(): Promise<Array<datatypes.IPRestriction>> {
1070
- const array: Array<datatypes.IPRestriction> = [];
1947
+ public async list(): Promise<Array<datatypes.EventDestination>> {
1948
+ const array: Array<datatypes.EventDestination> = [];
1071
1949
  for await (const item of this._asyncList()) {
1072
1950
  array.push(item);
1073
1951
  }
@@ -1075,9 +1953,9 @@ export class IPRestrictions {
1075
1953
  }
1076
1954
  private _pagedList(
1077
1955
  arg: datatypes.Paging
1078
- ): Promise<datatypes.IPRestrictionList> {
1956
+ ): Promise<datatypes.EventDestinationList> {
1079
1957
  return this.httpClient
1080
- .url(`/ip_restrictions`)
1958
+ .url(`/event_destinations`)
1081
1959
  .query(arg)
1082
1960
  .get()
1083
1961
  .json(payload => util.deserializeResult(payload))
@@ -1091,7 +1969,7 @@ export class IPRestrictions {
1091
1969
  while (nextPage) {
1092
1970
  const pagedList = await this._pagedList(page);
1093
1971
  nextPage = pagedList.nextPageUri;
1094
- const items: datatypes.IPRestriction[] = pagedList.ipRestrictions;
1972
+ const items: datatypes.EventDestination[] = pagedList.eventDestinations;
1095
1973
 
1096
1974
  if (nextPage) {
1097
1975
  page = {
@@ -1106,70 +1984,66 @@ export class IPRestrictions {
1106
1984
  }
1107
1985
  }
1108
1986
  /**
1109
- * Update attributes of an IP restriction by ID
1987
+ * Update attributes of an Event Destination.
1110
1988
  */
1111
1989
  public update(
1112
- arg: datatypes.IPRestrictionUpdate
1113
- ): Promise<datatypes.IPRestriction> {
1990
+ arg: datatypes.EventDestinationUpdate
1991
+ ): Promise<datatypes.EventDestination> {
1114
1992
  return this.httpClient
1115
- .url(`/ip_restrictions/${arg.id}`)
1993
+ .url(`/event_destinations/${arg.id}`)
1116
1994
  .patch(util.serializeArgument(arg))
1117
1995
  .json(payload => util.deserializeResult(payload))
1118
1996
  .then(f => f, util.onRejected);
1119
1997
  }
1120
1998
  }
1121
1999
 
1122
- /**
1123
- * The IP Whitelist is deprecated and will be removed. Use an IP Restriction
1124
- with an `endpoints` type instead.
1125
- */
1126
- export class IPWhitelist {
2000
+ export class EventSubscriptions {
1127
2001
  private httpClient: Wretcher;
1128
2002
 
1129
- /** Do not construct this object directly, use the <code>ipWhitelist</code> property of an <code>Ngrok</code> client object instead. */
2003
+ /** Do not construct this object directly, use the <code>eventSubscriptions</code> property of an <code>Ngrok</code> client object instead. */
1130
2004
  public constructor(httpClient: Wretcher) {
1131
2005
  this.httpClient = httpClient;
1132
2006
  }
1133
2007
  /**
1134
- * Create a new IP whitelist entry that will restrict traffic to all tunnel endpoints on the account.
2008
+ * Create an Event Subscription.
1135
2009
  */
1136
2010
  public create(
1137
- arg: datatypes.IPWhitelistEntryCreate
1138
- ): Promise<datatypes.IPWhitelistEntry> {
2011
+ arg: datatypes.EventSubscriptionCreate
2012
+ ): Promise<datatypes.EventSubscription> {
1139
2013
  return this.httpClient
1140
- .url(`/ip_whitelist`)
2014
+ .url(`/event_subscriptions`)
1141
2015
  .post(util.serializeArgument(arg))
1142
2016
  .json(payload => util.deserializeResult(payload))
1143
2017
  .then(f => f, util.onRejected);
1144
2018
  }
1145
2019
 
1146
2020
  /**
1147
- * Delete an IP whitelist entry.
2021
+ * Delete an Event Subscription.
1148
2022
  */
1149
2023
  public delete(arg: datatypes.Item): Promise<void> {
1150
2024
  return this.httpClient
1151
- .url(`/ip_whitelist/${arg.id}`)
2025
+ .url(`/event_subscriptions/${arg.id}`)
1152
2026
  .delete()
1153
2027
  .json(payload => util.deserializeResult(payload))
1154
2028
  .then(f => f, util.onRejected);
1155
2029
  }
1156
2030
 
1157
2031
  /**
1158
- * Get detailed information about an IP whitelist entry by ID.
2032
+ * Get an Event Subscription by ID.
1159
2033
  */
1160
- public get(arg: datatypes.Item): Promise<datatypes.IPWhitelistEntry> {
2034
+ public get(arg: datatypes.Item): Promise<datatypes.EventSubscription> {
1161
2035
  return this.httpClient
1162
- .url(`/ip_whitelist/${arg.id}`)
2036
+ .url(`/event_subscriptions/${arg.id}`)
1163
2037
  .get()
1164
2038
  .json(payload => util.deserializeResult(payload))
1165
2039
  .then(f => f, util.onRejected);
1166
2040
  }
1167
2041
 
1168
2042
  /**
1169
- * List all IP whitelist entries on this account
2043
+ * List this Account's Event Subscriptions.
1170
2044
  */
1171
- public async list(): Promise<Array<datatypes.IPWhitelistEntry>> {
1172
- const array: Array<datatypes.IPWhitelistEntry> = [];
2045
+ public async list(): Promise<Array<datatypes.EventSubscription>> {
2046
+ const array: Array<datatypes.EventSubscription> = [];
1173
2047
  for await (const item of this._asyncList()) {
1174
2048
  array.push(item);
1175
2049
  }
@@ -1177,9 +2051,9 @@ export class IPWhitelist {
1177
2051
  }
1178
2052
  private _pagedList(
1179
2053
  arg: datatypes.Paging
1180
- ): Promise<datatypes.IPWhitelistEntryList> {
2054
+ ): Promise<datatypes.EventSubscriptionList> {
1181
2055
  return this.httpClient
1182
- .url(`/ip_whitelist`)
2056
+ .url(`/event_subscriptions`)
1183
2057
  .query(arg)
1184
2058
  .get()
1185
2059
  .json(payload => util.deserializeResult(payload))
@@ -1193,7 +2067,7 @@ export class IPWhitelist {
1193
2067
  while (nextPage) {
1194
2068
  const pagedList = await this._pagedList(page);
1195
2069
  nextPage = pagedList.nextPageUri;
1196
- const items: datatypes.IPWhitelistEntry[] = pagedList.whitelist;
2070
+ const items: datatypes.EventSubscription[] = pagedList.eventSubscriptions;
1197
2071
 
1198
2072
  if (nextPage) {
1199
2073
  page = {
@@ -1208,424 +2082,389 @@ export class IPWhitelist {
1208
2082
  }
1209
2083
  }
1210
2084
  /**
1211
- * Update attributes of an IP whitelist entry by ID
2085
+ * Update an Event Subscription.
1212
2086
  */
1213
2087
  public update(
1214
- arg: datatypes.IPWhitelistEntryUpdate
1215
- ): Promise<datatypes.IPWhitelistEntry> {
2088
+ arg: datatypes.EventSubscriptionUpdate
2089
+ ): Promise<datatypes.EventSubscription> {
1216
2090
  return this.httpClient
1217
- .url(`/ip_whitelist/${arg.id}`)
2091
+ .url(`/event_subscriptions/${arg.id}`)
1218
2092
  .patch(util.serializeArgument(arg))
1219
2093
  .json(payload => util.deserializeResult(payload))
1220
2094
  .then(f => f, util.onRejected);
1221
2095
  }
1222
2096
  }
1223
2097
 
1224
- export class EndpointLoggingModule {
1225
- private httpClient: Wretcher;
1226
-
1227
- /** Do not construct this object directly, use the <code>endpointLoggingModule</code> property of an <code>Ngrok</code> client object instead. */
1228
- public constructor(httpClient: Wretcher) {
1229
- this.httpClient = httpClient;
1230
- }
1231
- public replace(
1232
- arg: datatypes.EndpointLoggingReplace
1233
- ): Promise<datatypes.EndpointLogging> {
1234
- return this.httpClient
1235
- .url(`/endpoint_configurations/${arg.id}/logging`)
1236
- .put(util.serializeArgument(arg))
1237
- .json(payload => util.deserializeResult(payload))
1238
- .then(f => f, util.onRejected);
1239
- }
1240
-
1241
- public get(arg: datatypes.Item): Promise<datatypes.EndpointLogging> {
1242
- return this.httpClient
1243
- .url(`/endpoint_configurations/${arg.id}/logging`)
1244
- .get()
1245
- .json(payload => util.deserializeResult(payload))
1246
- .then(f => f, util.onRejected);
1247
- }
1248
-
1249
- public delete(arg: datatypes.Item): Promise<void> {
1250
- return this.httpClient
1251
- .url(`/endpoint_configurations/${arg.id}/logging`)
1252
- .delete()
1253
- .json(payload => util.deserializeResult(payload))
1254
- .then(f => f, util.onRejected);
1255
- }
1256
- }
1257
-
1258
- export class EndpointCircuitBreakerModule {
1259
- private httpClient: Wretcher;
1260
-
1261
- /** Do not construct this object directly, use the <code>endpointCircuitBreakerModule</code> property of an <code>Ngrok</code> client object instead. */
1262
- public constructor(httpClient: Wretcher) {
1263
- this.httpClient = httpClient;
1264
- }
1265
- public replace(
1266
- arg: datatypes.EndpointCircuitBreakerReplace
1267
- ): Promise<datatypes.EndpointCircuitBreaker> {
1268
- return this.httpClient
1269
- .url(`/endpoint_configurations/${arg.id}/circuit_breaker`)
1270
- .put(util.serializeArgument(arg))
1271
- .json(payload => util.deserializeResult(payload))
1272
- .then(f => f, util.onRejected);
1273
- }
1274
-
1275
- public get(arg: datatypes.Item): Promise<datatypes.EndpointCircuitBreaker> {
1276
- return this.httpClient
1277
- .url(`/endpoint_configurations/${arg.id}/circuit_breaker`)
1278
- .get()
1279
- .json(payload => util.deserializeResult(payload))
1280
- .then(f => f, util.onRejected);
1281
- }
1282
-
1283
- public delete(arg: datatypes.Item): Promise<void> {
1284
- return this.httpClient
1285
- .url(`/endpoint_configurations/${arg.id}/circuit_breaker`)
1286
- .delete()
1287
- .json(payload => util.deserializeResult(payload))
1288
- .then(f => f, util.onRejected);
1289
- }
1290
- }
1291
-
1292
- export class EndpointCompressionModule {
2098
+ export class EventSources {
1293
2099
  private httpClient: Wretcher;
1294
2100
 
1295
- /** Do not construct this object directly, use the <code>endpointCompressionModule</code> property of an <code>Ngrok</code> client object instead. */
2101
+ /** Do not construct this object directly, use the <code>eventSources</code> property of an <code>Ngrok</code> client object instead. */
1296
2102
  public constructor(httpClient: Wretcher) {
1297
2103
  this.httpClient = httpClient;
1298
2104
  }
1299
- public replace(
1300
- arg: datatypes.EndpointCompressionReplace
1301
- ): Promise<datatypes.EndpointCompression> {
1302
- return this.httpClient
1303
- .url(`/endpoint_configurations/${arg.id}/compression`)
1304
- .put(util.serializeArgument(arg))
1305
- .json(payload => util.deserializeResult(payload))
1306
- .then(f => f, util.onRejected);
1307
- }
1308
-
1309
- public get(arg: datatypes.Item): Promise<datatypes.EndpointCompression> {
2105
+ /**
2106
+ * Add an additional type for which this event subscription will trigger
2107
+ */
2108
+ public create(
2109
+ arg: datatypes.EventSourceCreate
2110
+ ): Promise<datatypes.EventSource> {
1310
2111
  return this.httpClient
1311
- .url(`/endpoint_configurations/${arg.id}/compression`)
1312
- .get()
2112
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
2113
+ .post(util.serializeArgument(arg))
1313
2114
  .json(payload => util.deserializeResult(payload))
1314
2115
  .then(f => f, util.onRejected);
1315
2116
  }
1316
2117
 
1317
- public delete(arg: datatypes.Item): Promise<void> {
2118
+ /**
2119
+ * Remove a type for which this event subscription will trigger
2120
+ */
2121
+ public delete(arg: datatypes.EventSourceItem): Promise<void> {
1318
2122
  return this.httpClient
1319
- .url(`/endpoint_configurations/${arg.id}/compression`)
2123
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
1320
2124
  .delete()
1321
2125
  .json(payload => util.deserializeResult(payload))
1322
2126
  .then(f => f, util.onRejected);
1323
2127
  }
1324
- }
1325
-
1326
- export class EndpointTLSTerminationModule {
1327
- private httpClient: Wretcher;
1328
-
1329
- /** Do not construct this object directly, use the <code>endpointTlsTerminationModule</code> property of an <code>Ngrok</code> client object instead. */
1330
- public constructor(httpClient: Wretcher) {
1331
- this.httpClient = httpClient;
1332
- }
1333
- public replace(
1334
- arg: datatypes.EndpointTLSTerminationReplace
1335
- ): Promise<datatypes.EndpointTLSTermination> {
1336
- return this.httpClient
1337
- .url(`/endpoint_configurations/${arg.id}/tls_termination`)
1338
- .put(util.serializeArgument(arg))
1339
- .json(payload => util.deserializeResult(payload))
1340
- .then(f => f, util.onRejected);
1341
- }
1342
2128
 
1343
- public get(arg: datatypes.Item): Promise<datatypes.EndpointTLSTermination> {
2129
+ /**
2130
+ * Get the details for a given type that triggers for the given event subscription
2131
+ */
2132
+ public get(arg: datatypes.EventSourceItem): Promise<datatypes.EventSource> {
1344
2133
  return this.httpClient
1345
- .url(`/endpoint_configurations/${arg.id}/tls_termination`)
2134
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
1346
2135
  .get()
1347
2136
  .json(payload => util.deserializeResult(payload))
1348
2137
  .then(f => f, util.onRejected);
1349
2138
  }
1350
2139
 
1351
- public delete(arg: datatypes.Item): Promise<void> {
1352
- return this.httpClient
1353
- .url(`/endpoint_configurations/${arg.id}/tls_termination`)
1354
- .delete()
1355
- .json(payload => util.deserializeResult(payload))
1356
- .then(f => f, util.onRejected);
1357
- }
1358
- }
1359
-
1360
- export class EndpointIPPolicyModule {
1361
- private httpClient: Wretcher;
1362
-
1363
- /** Do not construct this object directly, use the <code>endpointIpPolicyModule</code> property of an <code>Ngrok</code> client object instead. */
1364
- public constructor(httpClient: Wretcher) {
1365
- this.httpClient = httpClient;
1366
- }
1367
- public replace(
1368
- arg: datatypes.EndpointIPPolicyReplace
1369
- ): Promise<datatypes.EndpointIPPolicy> {
1370
- return this.httpClient
1371
- .url(`/endpoint_configurations/${arg.id}/ip_policy`)
1372
- .put(util.serializeArgument(arg))
1373
- .json(payload => util.deserializeResult(payload))
1374
- .then(f => f, util.onRejected);
1375
- }
1376
-
1377
- public get(arg: datatypes.Item): Promise<datatypes.EndpointIPPolicy> {
2140
+ /**
2141
+ * List the types for which this event subscription will trigger
2142
+ */
2143
+ public list(
2144
+ arg: datatypes.EventSourcePaging
2145
+ ): Promise<datatypes.EventSourceList> {
1378
2146
  return this.httpClient
1379
- .url(`/endpoint_configurations/${arg.id}/ip_policy`)
2147
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources`)
1380
2148
  .get()
1381
2149
  .json(payload => util.deserializeResult(payload))
1382
2150
  .then(f => f, util.onRejected);
1383
2151
  }
1384
2152
 
1385
- public delete(arg: datatypes.Item): Promise<void> {
2153
+ /**
2154
+ * Update the type for which this event subscription will trigger
2155
+ */
2156
+ public update(
2157
+ arg: datatypes.EventSourceUpdate
2158
+ ): Promise<datatypes.EventSource> {
1386
2159
  return this.httpClient
1387
- .url(`/endpoint_configurations/${arg.id}/ip_policy`)
1388
- .delete()
2160
+ .url(`/event_subscriptions/${arg.subscriptionId}/sources/${arg.type}`)
2161
+ .patch(util.serializeArgument(arg))
1389
2162
  .json(payload => util.deserializeResult(payload))
1390
2163
  .then(f => f, util.onRejected);
1391
2164
  }
1392
2165
  }
1393
2166
 
1394
- export class EndpointMutualTLSModule {
2167
+ /**
2168
+ * IP Policies are reusable groups of CIDR ranges with an `allow` or `deny`
2169
+ action. They can be attached to endpoints via the Endpoint Configuration IP
2170
+ Policy module. They can also be used with IP Restrictions to control source
2171
+ IP ranges that can start tunnel sessions and connect to the API and dashboard.
2172
+ */
2173
+ export class IPPolicies {
1395
2174
  private httpClient: Wretcher;
1396
2175
 
1397
- /** Do not construct this object directly, use the <code>endpointMutualTlsModule</code> property of an <code>Ngrok</code> client object instead. */
2176
+ /** Do not construct this object directly, use the <code>ipPolicies</code> property of an <code>Ngrok</code> client object instead. */
1398
2177
  public constructor(httpClient: Wretcher) {
1399
2178
  this.httpClient = httpClient;
1400
2179
  }
1401
- public replace(
1402
- arg: datatypes.EndpointMutualTLSReplace
1403
- ): Promise<datatypes.EndpointMutualTLS> {
1404
- return this.httpClient
1405
- .url(`/endpoint_configurations/${arg.id}/mutual_tls`)
1406
- .put(util.serializeArgument(arg))
1407
- .json(payload => util.deserializeResult(payload))
1408
- .then(f => f, util.onRejected);
1409
- }
1410
-
1411
- public get(arg: datatypes.Item): Promise<datatypes.EndpointMutualTLS> {
2180
+ /**
2181
+ * Create a new IP policy. It will not apply to any traffic until you associate to a traffic source via an endpoint configuration or IP restriction.
2182
+ */
2183
+ public create(arg: datatypes.IPPolicyCreate): Promise<datatypes.IPPolicy> {
1412
2184
  return this.httpClient
1413
- .url(`/endpoint_configurations/${arg.id}/mutual_tls`)
1414
- .get()
2185
+ .url(`/ip_policies`)
2186
+ .post(util.serializeArgument(arg))
1415
2187
  .json(payload => util.deserializeResult(payload))
1416
2188
  .then(f => f, util.onRejected);
1417
2189
  }
1418
2190
 
2191
+ /**
2192
+ * Delete an IP policy. If the IP policy is referenced by another object for the purposes of traffic restriction it will be treated as if the IP policy remains but has zero rules.
2193
+ */
1419
2194
  public delete(arg: datatypes.Item): Promise<void> {
1420
2195
  return this.httpClient
1421
- .url(`/endpoint_configurations/${arg.id}/mutual_tls`)
2196
+ .url(`/ip_policies/${arg.id}`)
1422
2197
  .delete()
1423
2198
  .json(payload => util.deserializeResult(payload))
1424
2199
  .then(f => f, util.onRejected);
1425
2200
  }
1426
- }
1427
-
1428
- export class EndpointRequestHeadersModule {
1429
- private httpClient: Wretcher;
1430
-
1431
- /** Do not construct this object directly, use the <code>endpointRequestHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1432
- public constructor(httpClient: Wretcher) {
1433
- this.httpClient = httpClient;
1434
- }
1435
- public replace(
1436
- arg: datatypes.EndpointRequestHeadersReplace
1437
- ): Promise<datatypes.EndpointRequestHeaders> {
1438
- return this.httpClient
1439
- .url(`/endpoint_configurations/${arg.id}/request_headers`)
1440
- .put(util.serializeArgument(arg))
1441
- .json(payload => util.deserializeResult(payload))
1442
- .then(f => f, util.onRejected);
1443
- }
1444
2201
 
1445
- public get(arg: datatypes.Item): Promise<datatypes.EndpointRequestHeaders> {
2202
+ /**
2203
+ * Get detailed information about an IP policy by ID.
2204
+ */
2205
+ public get(arg: datatypes.Item): Promise<datatypes.IPPolicy> {
1446
2206
  return this.httpClient
1447
- .url(`/endpoint_configurations/${arg.id}/request_headers`)
2207
+ .url(`/ip_policies/${arg.id}`)
1448
2208
  .get()
1449
2209
  .json(payload => util.deserializeResult(payload))
1450
2210
  .then(f => f, util.onRejected);
1451
2211
  }
1452
2212
 
1453
- public delete(arg: datatypes.Item): Promise<void> {
1454
- return this.httpClient
1455
- .url(`/endpoint_configurations/${arg.id}/request_headers`)
1456
- .delete()
1457
- .json(payload => util.deserializeResult(payload))
1458
- .then(f => f, util.onRejected);
1459
- }
1460
- }
1461
-
1462
- export class EndpointResponseHeadersModule {
1463
- private httpClient: Wretcher;
1464
-
1465
- /** Do not construct this object directly, use the <code>endpointResponseHeadersModule</code> property of an <code>Ngrok</code> client object instead. */
1466
- public constructor(httpClient: Wretcher) {
1467
- this.httpClient = httpClient;
1468
- }
1469
- public replace(
1470
- arg: datatypes.EndpointResponseHeadersReplace
1471
- ): Promise<datatypes.EndpointResponseHeaders> {
1472
- return this.httpClient
1473
- .url(`/endpoint_configurations/${arg.id}/response_headers`)
1474
- .put(util.serializeArgument(arg))
1475
- .json(payload => util.deserializeResult(payload))
1476
- .then(f => f, util.onRejected);
2213
+ /**
2214
+ * List all IP policies on this account
2215
+ */
2216
+ public async list(): Promise<Array<datatypes.IPPolicy>> {
2217
+ const array: Array<datatypes.IPPolicy> = [];
2218
+ for await (const item of this._asyncList()) {
2219
+ array.push(item);
2220
+ }
2221
+ return array;
1477
2222
  }
1478
-
1479
- public get(arg: datatypes.Item): Promise<datatypes.EndpointResponseHeaders> {
2223
+ private _pagedList(arg: datatypes.Paging): Promise<datatypes.IPPolicyList> {
1480
2224
  return this.httpClient
1481
- .url(`/endpoint_configurations/${arg.id}/response_headers`)
2225
+ .url(`/ip_policies`)
2226
+ .query(arg)
1482
2227
  .get()
1483
2228
  .json(payload => util.deserializeResult(payload))
1484
- .then(f => f, util.onRejected);
2229
+ .then(util.onFulfilled, util.onRejected);
1485
2230
  }
2231
+ private async *_asyncList() {
2232
+ const limit = '100';
2233
+ let nextPage = 'initial loop';
2234
+ let page: datatypes.Paging = { limit: limit };
1486
2235
 
1487
- public delete(arg: datatypes.Item): Promise<void> {
2236
+ while (nextPage) {
2237
+ const pagedList = await this._pagedList(page);
2238
+ nextPage = pagedList.nextPageUri;
2239
+ const items: datatypes.IPPolicy[] = pagedList.ipPolicies;
2240
+
2241
+ if (nextPage) {
2242
+ page = {
2243
+ beforeId: items[items.length - 1].id,
2244
+ limit: limit,
2245
+ };
2246
+ }
2247
+
2248
+ for (const item of items) {
2249
+ yield item;
2250
+ }
2251
+ }
2252
+ }
2253
+ /**
2254
+ * Update attributes of an IP policy by ID
2255
+ */
2256
+ public update(arg: datatypes.IPPolicyUpdate): Promise<datatypes.IPPolicy> {
1488
2257
  return this.httpClient
1489
- .url(`/endpoint_configurations/${arg.id}/response_headers`)
1490
- .delete()
2258
+ .url(`/ip_policies/${arg.id}`)
2259
+ .patch(util.serializeArgument(arg))
1491
2260
  .json(payload => util.deserializeResult(payload))
1492
2261
  .then(f => f, util.onRejected);
1493
2262
  }
1494
2263
  }
1495
2264
 
1496
- export class EndpointOAuthModule {
2265
+ /**
2266
+ * IP Policy Rules are the IPv4 or IPv6 CIDRs entries that
2267
+ make up an IP Policy.
2268
+ */
2269
+ export class IPPolicyRules {
1497
2270
  private httpClient: Wretcher;
1498
2271
 
1499
- /** Do not construct this object directly, use the <code>endpointOAuthModule</code> property of an <code>Ngrok</code> client object instead. */
2272
+ /** Do not construct this object directly, use the <code>ipPolicyRules</code> property of an <code>Ngrok</code> client object instead. */
1500
2273
  public constructor(httpClient: Wretcher) {
1501
2274
  this.httpClient = httpClient;
1502
2275
  }
1503
- public replace(
1504
- arg: datatypes.EndpointOAuthReplace
1505
- ): Promise<datatypes.EndpointOAuth> {
1506
- return this.httpClient
1507
- .url(`/endpoint_configurations/${arg.id}/oauth`)
1508
- .put(util.serializeArgument(arg))
1509
- .json(payload => util.deserializeResult(payload))
1510
- .then(f => f, util.onRejected);
1511
- }
1512
-
1513
- public get(arg: datatypes.Item): Promise<datatypes.EndpointOAuth> {
2276
+ /**
2277
+ * Create a new IP policy rule attached to an IP Policy.
2278
+ */
2279
+ public create(
2280
+ arg: datatypes.IPPolicyRuleCreate
2281
+ ): Promise<datatypes.IPPolicyRule> {
1514
2282
  return this.httpClient
1515
- .url(`/endpoint_configurations/${arg.id}/oauth`)
1516
- .get()
2283
+ .url(`/ip_policy_rules`)
2284
+ .post(util.serializeArgument(arg))
1517
2285
  .json(payload => util.deserializeResult(payload))
1518
2286
  .then(f => f, util.onRejected);
1519
2287
  }
1520
2288
 
2289
+ /**
2290
+ * Delete an IP policy rule.
2291
+ */
1521
2292
  public delete(arg: datatypes.Item): Promise<void> {
1522
2293
  return this.httpClient
1523
- .url(`/endpoint_configurations/${arg.id}/oauth`)
2294
+ .url(`/ip_policy_rules/${arg.id}`)
1524
2295
  .delete()
1525
2296
  .json(payload => util.deserializeResult(payload))
1526
2297
  .then(f => f, util.onRejected);
1527
2298
  }
1528
- }
1529
2299
 
1530
- export class EndpointWebhookValidationModule {
1531
- private httpClient: Wretcher;
1532
-
1533
- /** Do not construct this object directly, use the <code>endpointWebhookValidationModule</code> property of an <code>Ngrok</code> client object instead. */
1534
- public constructor(httpClient: Wretcher) {
1535
- this.httpClient = httpClient;
1536
- }
1537
- public replace(
1538
- arg: datatypes.EndpointWebhookValidationReplace
1539
- ): Promise<datatypes.EndpointWebhookValidation> {
2300
+ /**
2301
+ * Get detailed information about an IP policy rule by ID.
2302
+ */
2303
+ public get(arg: datatypes.Item): Promise<datatypes.IPPolicyRule> {
1540
2304
  return this.httpClient
1541
- .url(`/endpoint_configurations/${arg.id}/webhook_validation`)
1542
- .put(util.serializeArgument(arg))
2305
+ .url(`/ip_policy_rules/${arg.id}`)
2306
+ .get()
1543
2307
  .json(payload => util.deserializeResult(payload))
1544
2308
  .then(f => f, util.onRejected);
1545
2309
  }
1546
2310
 
1547
- public get(
1548
- arg: datatypes.Item
1549
- ): Promise<datatypes.EndpointWebhookValidation> {
2311
+ /**
2312
+ * List all IP policy rules on this account
2313
+ */
2314
+ public async list(): Promise<Array<datatypes.IPPolicyRule>> {
2315
+ const array: Array<datatypes.IPPolicyRule> = [];
2316
+ for await (const item of this._asyncList()) {
2317
+ array.push(item);
2318
+ }
2319
+ return array;
2320
+ }
2321
+ private _pagedList(
2322
+ arg: datatypes.Paging
2323
+ ): Promise<datatypes.IPPolicyRuleList> {
1550
2324
  return this.httpClient
1551
- .url(`/endpoint_configurations/${arg.id}/webhook_validation`)
2325
+ .url(`/ip_policy_rules`)
2326
+ .query(arg)
1552
2327
  .get()
1553
2328
  .json(payload => util.deserializeResult(payload))
1554
- .then(f => f, util.onRejected);
2329
+ .then(util.onFulfilled, util.onRejected);
1555
2330
  }
2331
+ private async *_asyncList() {
2332
+ const limit = '100';
2333
+ let nextPage = 'initial loop';
2334
+ let page: datatypes.Paging = { limit: limit };
1556
2335
 
1557
- public delete(arg: datatypes.Item): Promise<void> {
2336
+ while (nextPage) {
2337
+ const pagedList = await this._pagedList(page);
2338
+ nextPage = pagedList.nextPageUri;
2339
+ const items: datatypes.IPPolicyRule[] = pagedList.ipPolicyRules;
2340
+
2341
+ if (nextPage) {
2342
+ page = {
2343
+ beforeId: items[items.length - 1].id,
2344
+ limit: limit,
2345
+ };
2346
+ }
2347
+
2348
+ for (const item of items) {
2349
+ yield item;
2350
+ }
2351
+ }
2352
+ }
2353
+ /**
2354
+ * Update attributes of an IP policy rule by ID
2355
+ */
2356
+ public update(
2357
+ arg: datatypes.IPPolicyRuleUpdate
2358
+ ): Promise<datatypes.IPPolicyRule> {
1558
2359
  return this.httpClient
1559
- .url(`/endpoint_configurations/${arg.id}/webhook_validation`)
1560
- .delete()
2360
+ .url(`/ip_policy_rules/${arg.id}`)
2361
+ .patch(util.serializeArgument(arg))
1561
2362
  .json(payload => util.deserializeResult(payload))
1562
2363
  .then(f => f, util.onRejected);
1563
2364
  }
1564
2365
  }
1565
2366
 
1566
- export class EndpointSAMLModule {
2367
+ /**
2368
+ * An IP restriction is a restriction placed on the CIDRs that are allowed to
2369
+ initiate traffic to a specific aspect of your ngrok account. An IP
2370
+ restriction has a type which defines the ingress it applies to. IP
2371
+ restrictions can be used to enforce the source IPs that can make API
2372
+ requests, log in to the dashboard, start ngrok agents, and connect to your
2373
+ public-facing endpoints.
2374
+ */
2375
+ export class IPRestrictions {
1567
2376
  private httpClient: Wretcher;
1568
2377
 
1569
- /** Do not construct this object directly, use the <code>endpointSamlModule</code> property of an <code>Ngrok</code> client object instead. */
2378
+ /** Do not construct this object directly, use the <code>ipRestrictions</code> property of an <code>Ngrok</code> client object instead. */
1570
2379
  public constructor(httpClient: Wretcher) {
1571
2380
  this.httpClient = httpClient;
1572
2381
  }
1573
- public replace(
1574
- arg: datatypes.EndpointSAMLReplace
1575
- ): Promise<datatypes.EndpointSAML> {
1576
- return this.httpClient
1577
- .url(`/endpoint_configurations/${arg.id}/saml`)
1578
- .put(util.serializeArgument(arg))
1579
- .json(payload => util.deserializeResult(payload))
1580
- .then(f => f, util.onRejected);
1581
- }
1582
-
1583
- public get(arg: datatypes.Item): Promise<datatypes.EndpointSAML> {
2382
+ /**
2383
+ * Create a new IP restriction
2384
+ */
2385
+ public create(
2386
+ arg: datatypes.IPRestrictionCreate
2387
+ ): Promise<datatypes.IPRestriction> {
1584
2388
  return this.httpClient
1585
- .url(`/endpoint_configurations/${arg.id}/saml`)
1586
- .get()
2389
+ .url(`/ip_restrictions`)
2390
+ .post(util.serializeArgument(arg))
1587
2391
  .json(payload => util.deserializeResult(payload))
1588
2392
  .then(f => f, util.onRejected);
1589
2393
  }
1590
2394
 
2395
+ /**
2396
+ * Delete an IP restriction
2397
+ */
1591
2398
  public delete(arg: datatypes.Item): Promise<void> {
1592
2399
  return this.httpClient
1593
- .url(`/endpoint_configurations/${arg.id}/saml`)
2400
+ .url(`/ip_restrictions/${arg.id}`)
1594
2401
  .delete()
1595
2402
  .json(payload => util.deserializeResult(payload))
1596
2403
  .then(f => f, util.onRejected);
1597
2404
  }
1598
- }
1599
-
1600
- export class EndpointOIDCModule {
1601
- private httpClient: Wretcher;
1602
2405
 
1603
- /** Do not construct this object directly, use the <code>endpointOidcModule</code> property of an <code>Ngrok</code> client object instead. */
1604
- public constructor(httpClient: Wretcher) {
1605
- this.httpClient = httpClient;
1606
- }
1607
- public replace(
1608
- arg: datatypes.EndpointOIDCReplace
1609
- ): Promise<datatypes.EndpointOIDC> {
2406
+ /**
2407
+ * Get detailed information about an IP restriction
2408
+ */
2409
+ public get(arg: datatypes.Item): Promise<datatypes.IPRestriction> {
1610
2410
  return this.httpClient
1611
- .url(`/endpoint_configurations/${arg.id}/oidc`)
1612
- .put(util.serializeArgument(arg))
2411
+ .url(`/ip_restrictions/${arg.id}`)
2412
+ .get()
1613
2413
  .json(payload => util.deserializeResult(payload))
1614
2414
  .then(f => f, util.onRejected);
1615
2415
  }
1616
2416
 
1617
- public get(arg: datatypes.Item): Promise<datatypes.EndpointOIDC> {
2417
+ /**
2418
+ * List all IP restrictions on this account
2419
+ */
2420
+ public async list(): Promise<Array<datatypes.IPRestriction>> {
2421
+ const array: Array<datatypes.IPRestriction> = [];
2422
+ for await (const item of this._asyncList()) {
2423
+ array.push(item);
2424
+ }
2425
+ return array;
2426
+ }
2427
+ private _pagedList(
2428
+ arg: datatypes.Paging
2429
+ ): Promise<datatypes.IPRestrictionList> {
1618
2430
  return this.httpClient
1619
- .url(`/endpoint_configurations/${arg.id}/oidc`)
2431
+ .url(`/ip_restrictions`)
2432
+ .query(arg)
1620
2433
  .get()
1621
2434
  .json(payload => util.deserializeResult(payload))
1622
- .then(f => f, util.onRejected);
2435
+ .then(util.onFulfilled, util.onRejected);
1623
2436
  }
2437
+ private async *_asyncList() {
2438
+ const limit = '100';
2439
+ let nextPage = 'initial loop';
2440
+ let page: datatypes.Paging = { limit: limit };
1624
2441
 
1625
- public delete(arg: datatypes.Item): Promise<void> {
2442
+ while (nextPage) {
2443
+ const pagedList = await this._pagedList(page);
2444
+ nextPage = pagedList.nextPageUri;
2445
+ const items: datatypes.IPRestriction[] = pagedList.ipRestrictions;
2446
+
2447
+ if (nextPage) {
2448
+ page = {
2449
+ beforeId: items[items.length - 1].id,
2450
+ limit: limit,
2451
+ };
2452
+ }
2453
+
2454
+ for (const item of items) {
2455
+ yield item;
2456
+ }
2457
+ }
2458
+ }
2459
+ /**
2460
+ * Update attributes of an IP restriction by ID
2461
+ */
2462
+ public update(
2463
+ arg: datatypes.IPRestrictionUpdate
2464
+ ): Promise<datatypes.IPRestriction> {
1626
2465
  return this.httpClient
1627
- .url(`/endpoint_configurations/${arg.id}/oidc`)
1628
- .delete()
2466
+ .url(`/ip_restrictions/${arg.id}`)
2467
+ .patch(util.serializeArgument(arg))
1629
2468
  .json(payload => util.deserializeResult(payload))
1630
2469
  .then(f => f, util.onRejected);
1631
2470
  }
@@ -1732,17 +2571,6 @@ export class ReservedAddrs {
1732
2571
  .json(payload => util.deserializeResult(payload))
1733
2572
  .then(f => f, util.onRejected);
1734
2573
  }
1735
-
1736
- /**
1737
- * Detach the endpoint configuration attached to a reserved address.
1738
- */
1739
- public deleteEndpointConfig(arg: datatypes.Item): Promise<void> {
1740
- return this.httpClient
1741
- .url(`/reserved_addrs/${arg.id}/endpoint_configuration`)
1742
- .delete()
1743
- .json(payload => util.deserializeResult(payload))
1744
- .then(f => f, util.onRejected);
1745
- }
1746
2574
  }
1747
2575
 
1748
2576
  /**
@@ -1869,28 +2697,6 @@ export class ReservedDomains {
1869
2697
  .json(payload => util.deserializeResult(payload))
1870
2698
  .then(f => f, util.onRejected);
1871
2699
  }
1872
-
1873
- /**
1874
- * Detach the http endpoint configuration attached to a reserved domain.
1875
- */
1876
- public deleteHttpEndpointConfig(arg: datatypes.Item): Promise<void> {
1877
- return this.httpClient
1878
- .url(`/reserved_domains/${arg.id}/http_endpoint_configuration`)
1879
- .delete()
1880
- .json(payload => util.deserializeResult(payload))
1881
- .then(f => f, util.onRejected);
1882
- }
1883
-
1884
- /**
1885
- * Detach the https endpoint configuration attached to a reserved domain.
1886
- */
1887
- public deleteHttpsEndpointConfig(arg: datatypes.Item): Promise<void> {
1888
- return this.httpClient
1889
- .url(`/reserved_domains/${arg.id}/https_endpoint_configuration`)
1890
- .delete()
1891
- .json(payload => util.deserializeResult(payload))
1892
- .then(f => f, util.onRejected);
1893
- }
1894
2700
  }
1895
2701
 
1896
2702
  /**
@@ -2561,4 +3367,14 @@ export class Tunnels {
2561
3367
  }
2562
3368
  }
2563
3369
  }
3370
+ /**
3371
+ * Get the status of a tunnel by ID
3372
+ */
3373
+ public get(arg: datatypes.Item): Promise<datatypes.Tunnel> {
3374
+ return this.httpClient
3375
+ .url(`/tunnels/${arg.id}`)
3376
+ .get()
3377
+ .json(payload => util.deserializeResult(payload))
3378
+ .then(f => f, util.onRejected);
3379
+ }
2564
3380
  }