ngrok-api 0.9.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (413) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/doc/.gitkeep +0 -0
  4. data/doc/NgrokAPI/Client.html +1499 -125
  5. data/doc/NgrokAPI/Error.html +1 -1
  6. data/doc/NgrokAPI/Errors/NotFoundError.html +1 -1
  7. data/doc/NgrokAPI/Errors.html +1 -1
  8. data/doc/NgrokAPI/HttpClient.html +1 -1
  9. data/doc/NgrokAPI/Models/{ApiKey.html → APIKey.html} +108 -177
  10. data/doc/NgrokAPI/Models/AWSAuth.html +617 -0
  11. data/doc/NgrokAPI/Models/AWSCredentials.html +617 -0
  12. data/doc/NgrokAPI/Models/AWSRole.html +543 -0
  13. data/doc/NgrokAPI/Models/AbuseReport.html +987 -0
  14. data/doc/NgrokAPI/Models/AbuseReportHostname.html +617 -0
  15. data/doc/NgrokAPI/Models/CertificateAuthority.html +1439 -0
  16. data/doc/NgrokAPI/Models/Credential.html +1149 -0
  17. data/doc/NgrokAPI/Models/EndpointCircuitBreaker.html +913 -0
  18. data/doc/NgrokAPI/Models/EndpointCompression.html +543 -0
  19. data/doc/NgrokAPI/Models/EndpointConfiguration.html +1321 -510
  20. data/doc/NgrokAPI/Models/EndpointIPPolicy.html +617 -0
  21. data/doc/NgrokAPI/Models/EndpointIPPolicyMutate.html +617 -0
  22. data/doc/NgrokAPI/Models/EndpointLogging.html +617 -0
  23. data/doc/NgrokAPI/Models/EndpointLoggingMutate.html +617 -0
  24. data/doc/NgrokAPI/Models/EndpointMutualTLS.html +617 -0
  25. data/doc/NgrokAPI/Models/EndpointMutualTLSMutate.html +617 -0
  26. data/doc/NgrokAPI/Models/EndpointOAuth.html +987 -0
  27. data/doc/NgrokAPI/Models/EndpointOAuthFacebook.html +839 -0
  28. data/doc/NgrokAPI/Models/EndpointOAuthGitHub.html +987 -0
  29. data/doc/NgrokAPI/Models/EndpointOAuthGoogle.html +839 -0
  30. data/doc/NgrokAPI/Models/EndpointOAuthMicrosoft.html +839 -0
  31. data/doc/NgrokAPI/Models/EndpointOAuthProvider.html +765 -0
  32. data/doc/NgrokAPI/Models/EndpointOIDC.html +1135 -0
  33. data/doc/NgrokAPI/Models/EndpointRequestHeaders.html +691 -0
  34. data/doc/NgrokAPI/Models/EndpointResponseHeaders.html +691 -0
  35. data/doc/NgrokAPI/Models/EndpointSAML.html +1653 -0
  36. data/doc/NgrokAPI/Models/EndpointSAMLMutate.html +1283 -0
  37. data/doc/NgrokAPI/Models/EndpointTLSTermination.html +691 -0
  38. data/doc/NgrokAPI/Models/EndpointWebhookValidation.html +691 -0
  39. data/doc/NgrokAPI/Models/EventDestination.html +1058 -0
  40. data/doc/NgrokAPI/Models/EventSource.html +765 -0
  41. data/doc/NgrokAPI/Models/EventSourceReplace.html +691 -0
  42. data/doc/NgrokAPI/Models/EventStream.html +1309 -0
  43. data/doc/NgrokAPI/Models/EventSubscription.html +1058 -0
  44. data/doc/NgrokAPI/Models/EventTarget.html +765 -0
  45. data/doc/NgrokAPI/Models/EventTargetCloudwatchLogs.html +617 -0
  46. data/doc/NgrokAPI/Models/EventTargetFirehose.html +617 -0
  47. data/doc/NgrokAPI/Models/EventTargetKinesis.html +617 -0
  48. data/doc/NgrokAPI/Models/IPPolicy.html +1069 -0
  49. data/doc/NgrokAPI/Models/IPPolicyRule.html +1149 -0
  50. data/doc/NgrokAPI/Models/IPRestriction.html +1132 -0
  51. data/doc/NgrokAPI/Models/{TlsCertificate.html → IPWhitelistEntry.html} +168 -163
  52. data/doc/NgrokAPI/Models/Listable.html +1 -1
  53. data/doc/NgrokAPI/Models/Ref.html +617 -0
  54. data/doc/NgrokAPI/Models/ReservedAddr.html +1132 -0
  55. data/doc/NgrokAPI/Models/ReservedDomain.html +111 -1107
  56. data/doc/NgrokAPI/Models/ReservedDomainCertJob.html +839 -0
  57. data/doc/NgrokAPI/Models/ReservedDomainCertNSTarget.html +617 -0
  58. data/doc/NgrokAPI/Models/ReservedDomainCertPolicy.html +617 -0
  59. data/doc/NgrokAPI/Models/ReservedDomainCertStatus.html +617 -0
  60. data/doc/NgrokAPI/Models/SSHCertificateAuthority.html +1143 -0
  61. data/doc/NgrokAPI/Models/SSHCredential.html +1149 -0
  62. data/doc/NgrokAPI/Models/SSHHostCertificate.html +1513 -0
  63. data/doc/NgrokAPI/Models/SSHUserCertificate.html +1661 -0
  64. data/doc/NgrokAPI/Models/TLSCertificate.html +2179 -0
  65. data/doc/NgrokAPI/Models/TLSCertificateSANs.html +617 -0
  66. data/doc/NgrokAPI/Models/Tunnel.html +987 -0
  67. data/doc/NgrokAPI/Models/TunnelSession.html +1209 -0
  68. data/doc/NgrokAPI/Models.html +4 -4
  69. data/doc/NgrokAPI/PagedIterator.html +1 -1
  70. data/{docs/NgrokAPI/Services/ApiKeysClient.html → doc/NgrokAPI/Services/APIKeysClient.html} +287 -151
  71. data/doc/NgrokAPI/Services/AbuseReportsClient.html +723 -0
  72. data/doc/NgrokAPI/Services/CertificateAuthoritiesClient.html +1489 -0
  73. data/doc/NgrokAPI/Services/CredentialsClient.html +1534 -0
  74. data/doc/NgrokAPI/Services/EndpointCircuitBreakerModuleClient.html +1071 -0
  75. data/doc/NgrokAPI/Services/EndpointCompressionModuleClient.html +1071 -0
  76. data/doc/NgrokAPI/Services/EndpointConfigurationsClient.html +473 -371
  77. data/doc/NgrokAPI/Services/EndpointIPPolicyModuleClient.html +1071 -0
  78. data/doc/NgrokAPI/Services/EndpointLoggingModuleClient.html +1071 -0
  79. data/doc/NgrokAPI/Services/EndpointMutualTLSModuleClient.html +1071 -0
  80. data/doc/NgrokAPI/Services/EndpointOAuthModuleClient.html +1071 -0
  81. data/doc/NgrokAPI/Services/EndpointOIDCModuleClient.html +1071 -0
  82. data/doc/NgrokAPI/Services/EndpointRequestHeadersModuleClient.html +1071 -0
  83. data/doc/NgrokAPI/Services/EndpointResponseHeadersModuleClient.html +1071 -0
  84. data/doc/NgrokAPI/Services/EndpointSAMLModuleClient.html +1071 -0
  85. data/doc/NgrokAPI/Services/EndpointTLSTerminationModuleClient.html +1071 -0
  86. data/doc/NgrokAPI/Services/EndpointWebhookValidationModuleClient.html +1071 -0
  87. data/doc/NgrokAPI/Services/EventDestinationsClient.html +1609 -0
  88. data/doc/NgrokAPI/Services/EventSourcesClient.html +1348 -0
  89. data/doc/NgrokAPI/Services/EventStreamsClient.html +1691 -0
  90. data/doc/NgrokAPI/Services/EventSubscriptionsClient.html +1603 -0
  91. data/doc/NgrokAPI/Services/IPPoliciesClient.html +1488 -0
  92. data/doc/NgrokAPI/Services/IPPolicyRulesClient.html +1550 -0
  93. data/doc/NgrokAPI/Services/IPRestrictionsClient.html +1620 -0
  94. data/doc/NgrokAPI/Services/IPWhitelistClient.html +1488 -0
  95. data/doc/NgrokAPI/Services/ReservedAddrsClient.html +1793 -0
  96. data/doc/NgrokAPI/Services/ReservedDomainsClient.html +518 -333
  97. data/doc/NgrokAPI/Services/SSHCertificateAuthoritiesClient.html +1532 -0
  98. data/doc/NgrokAPI/Services/SSHCredentialsClient.html +1552 -0
  99. data/doc/NgrokAPI/Services/SSHHostCertificatesClient.html +1573 -0
  100. data/doc/NgrokAPI/Services/SSHUserCertificatesClient.html +1617 -0
  101. data/{docs/NgrokAPI/Services/TlsCertificatesClient.html → doc/NgrokAPI/Services/TLSCertificatesClient.html} +290 -198
  102. data/doc/NgrokAPI/Services/TunnelSessionsClient.html +1468 -0
  103. data/doc/NgrokAPI/Services/TunnelsClient.html +513 -0
  104. data/doc/NgrokAPI/Services.html +4 -4
  105. data/doc/NgrokAPI.html +3 -3
  106. data/doc/_index.html +624 -28
  107. data/doc/class_list.html +1 -1
  108. data/doc/file.README.html +1 -1
  109. data/doc/index.html +1 -1
  110. data/doc/method_list.html +7318 -286
  111. data/doc/top-level-namespace.html +1 -1
  112. data/docs/.gitkeep +0 -0
  113. data/docs/NgrokAPI/Client.html +1499 -125
  114. data/docs/NgrokAPI/Error.html +1 -1
  115. data/docs/NgrokAPI/Errors/NotFoundError.html +1 -1
  116. data/docs/NgrokAPI/Errors.html +1 -1
  117. data/docs/NgrokAPI/HttpClient.html +1 -1
  118. data/docs/NgrokAPI/Models/{ApiKey.html → APIKey.html} +108 -177
  119. data/docs/NgrokAPI/Models/AWSAuth.html +617 -0
  120. data/docs/NgrokAPI/Models/AWSCredentials.html +617 -0
  121. data/docs/NgrokAPI/Models/AWSRole.html +543 -0
  122. data/docs/NgrokAPI/Models/AbuseReport.html +987 -0
  123. data/docs/NgrokAPI/Models/AbuseReportHostname.html +617 -0
  124. data/docs/NgrokAPI/Models/CertificateAuthority.html +1439 -0
  125. data/docs/NgrokAPI/Models/Credential.html +1149 -0
  126. data/docs/NgrokAPI/Models/EndpointCircuitBreaker.html +913 -0
  127. data/docs/NgrokAPI/Models/EndpointCompression.html +543 -0
  128. data/docs/NgrokAPI/Models/EndpointConfiguration.html +1321 -510
  129. data/docs/NgrokAPI/Models/EndpointIPPolicy.html +617 -0
  130. data/docs/NgrokAPI/Models/EndpointIPPolicyMutate.html +617 -0
  131. data/docs/NgrokAPI/Models/EndpointLogging.html +617 -0
  132. data/docs/NgrokAPI/Models/EndpointLoggingMutate.html +617 -0
  133. data/docs/NgrokAPI/Models/EndpointMutualTLS.html +617 -0
  134. data/docs/NgrokAPI/Models/EndpointMutualTLSMutate.html +617 -0
  135. data/docs/NgrokAPI/Models/EndpointOAuth.html +987 -0
  136. data/docs/NgrokAPI/Models/EndpointOAuthFacebook.html +839 -0
  137. data/docs/NgrokAPI/Models/EndpointOAuthGitHub.html +987 -0
  138. data/docs/NgrokAPI/Models/EndpointOAuthGoogle.html +839 -0
  139. data/docs/NgrokAPI/Models/EndpointOAuthMicrosoft.html +839 -0
  140. data/docs/NgrokAPI/Models/EndpointOAuthProvider.html +765 -0
  141. data/docs/NgrokAPI/Models/EndpointOIDC.html +1135 -0
  142. data/docs/NgrokAPI/Models/EndpointRequestHeaders.html +691 -0
  143. data/docs/NgrokAPI/Models/EndpointResponseHeaders.html +691 -0
  144. data/docs/NgrokAPI/Models/EndpointSAML.html +1653 -0
  145. data/docs/NgrokAPI/Models/EndpointSAMLMutate.html +1283 -0
  146. data/docs/NgrokAPI/Models/EndpointTLSTermination.html +691 -0
  147. data/docs/NgrokAPI/Models/EndpointWebhookValidation.html +691 -0
  148. data/docs/NgrokAPI/Models/EventDestination.html +1058 -0
  149. data/docs/NgrokAPI/Models/EventSource.html +765 -0
  150. data/docs/NgrokAPI/Models/EventSourceReplace.html +691 -0
  151. data/docs/NgrokAPI/Models/EventStream.html +1309 -0
  152. data/docs/NgrokAPI/Models/EventSubscription.html +1058 -0
  153. data/docs/NgrokAPI/Models/EventTarget.html +765 -0
  154. data/docs/NgrokAPI/Models/EventTargetCloudwatchLogs.html +617 -0
  155. data/docs/NgrokAPI/Models/EventTargetFirehose.html +617 -0
  156. data/docs/NgrokAPI/Models/EventTargetKinesis.html +617 -0
  157. data/docs/NgrokAPI/Models/IPPolicy.html +1069 -0
  158. data/docs/NgrokAPI/Models/IPPolicyRule.html +1149 -0
  159. data/docs/NgrokAPI/Models/IPRestriction.html +1132 -0
  160. data/docs/NgrokAPI/Models/{TlsCertificate.html → IPWhitelistEntry.html} +168 -163
  161. data/docs/NgrokAPI/Models/Listable.html +1 -1
  162. data/docs/NgrokAPI/Models/Ref.html +617 -0
  163. data/docs/NgrokAPI/Models/ReservedAddr.html +1132 -0
  164. data/docs/NgrokAPI/Models/ReservedDomain.html +111 -1107
  165. data/docs/NgrokAPI/Models/ReservedDomainCertJob.html +839 -0
  166. data/docs/NgrokAPI/Models/ReservedDomainCertNSTarget.html +617 -0
  167. data/docs/NgrokAPI/Models/ReservedDomainCertPolicy.html +617 -0
  168. data/docs/NgrokAPI/Models/ReservedDomainCertStatus.html +617 -0
  169. data/docs/NgrokAPI/Models/SSHCertificateAuthority.html +1143 -0
  170. data/docs/NgrokAPI/Models/SSHCredential.html +1149 -0
  171. data/docs/NgrokAPI/Models/SSHHostCertificate.html +1513 -0
  172. data/docs/NgrokAPI/Models/SSHUserCertificate.html +1661 -0
  173. data/docs/NgrokAPI/Models/TLSCertificate.html +2179 -0
  174. data/docs/NgrokAPI/Models/TLSCertificateSANs.html +617 -0
  175. data/docs/NgrokAPI/Models/Tunnel.html +987 -0
  176. data/docs/NgrokAPI/Models/TunnelSession.html +1209 -0
  177. data/docs/NgrokAPI/Models.html +4 -4
  178. data/docs/NgrokAPI/PagedIterator.html +1 -1
  179. data/{doc/NgrokAPI/Services/ApiKeysClient.html → docs/NgrokAPI/Services/APIKeysClient.html} +287 -151
  180. data/docs/NgrokAPI/Services/AbuseReportsClient.html +723 -0
  181. data/docs/NgrokAPI/Services/CertificateAuthoritiesClient.html +1489 -0
  182. data/docs/NgrokAPI/Services/CredentialsClient.html +1534 -0
  183. data/docs/NgrokAPI/Services/EndpointCircuitBreakerModuleClient.html +1071 -0
  184. data/docs/NgrokAPI/Services/EndpointCompressionModuleClient.html +1071 -0
  185. data/docs/NgrokAPI/Services/EndpointConfigurationsClient.html +473 -371
  186. data/docs/NgrokAPI/Services/EndpointIPPolicyModuleClient.html +1071 -0
  187. data/docs/NgrokAPI/Services/EndpointLoggingModuleClient.html +1071 -0
  188. data/docs/NgrokAPI/Services/EndpointMutualTLSModuleClient.html +1071 -0
  189. data/docs/NgrokAPI/Services/EndpointOAuthModuleClient.html +1071 -0
  190. data/docs/NgrokAPI/Services/EndpointOIDCModuleClient.html +1071 -0
  191. data/docs/NgrokAPI/Services/EndpointRequestHeadersModuleClient.html +1071 -0
  192. data/docs/NgrokAPI/Services/EndpointResponseHeadersModuleClient.html +1071 -0
  193. data/docs/NgrokAPI/Services/EndpointSAMLModuleClient.html +1071 -0
  194. data/docs/NgrokAPI/Services/EndpointTLSTerminationModuleClient.html +1071 -0
  195. data/docs/NgrokAPI/Services/EndpointWebhookValidationModuleClient.html +1071 -0
  196. data/docs/NgrokAPI/Services/EventDestinationsClient.html +1609 -0
  197. data/docs/NgrokAPI/Services/EventSourcesClient.html +1348 -0
  198. data/docs/NgrokAPI/Services/EventStreamsClient.html +1691 -0
  199. data/docs/NgrokAPI/Services/EventSubscriptionsClient.html +1603 -0
  200. data/docs/NgrokAPI/Services/IPPoliciesClient.html +1488 -0
  201. data/docs/NgrokAPI/Services/IPPolicyRulesClient.html +1550 -0
  202. data/docs/NgrokAPI/Services/IPRestrictionsClient.html +1620 -0
  203. data/docs/NgrokAPI/Services/IPWhitelistClient.html +1488 -0
  204. data/docs/NgrokAPI/Services/ReservedAddrsClient.html +1793 -0
  205. data/docs/NgrokAPI/Services/ReservedDomainsClient.html +518 -333
  206. data/docs/NgrokAPI/Services/SSHCertificateAuthoritiesClient.html +1532 -0
  207. data/docs/NgrokAPI/Services/SSHCredentialsClient.html +1552 -0
  208. data/docs/NgrokAPI/Services/SSHHostCertificatesClient.html +1573 -0
  209. data/docs/NgrokAPI/Services/SSHUserCertificatesClient.html +1617 -0
  210. data/{doc/NgrokAPI/Services/TlsCertificatesClient.html → docs/NgrokAPI/Services/TLSCertificatesClient.html} +290 -198
  211. data/docs/NgrokAPI/Services/TunnelSessionsClient.html +1468 -0
  212. data/docs/NgrokAPI/Services/TunnelsClient.html +513 -0
  213. data/docs/NgrokAPI/Services.html +4 -4
  214. data/docs/NgrokAPI.html +3 -3
  215. data/docs/_index.html +624 -28
  216. data/docs/class_list.html +1 -1
  217. data/docs/file.README.html +1 -1
  218. data/docs/index.html +1 -1
  219. data/docs/method_list.html +7318 -286
  220. data/docs/top-level-namespace.html +1 -1
  221. data/lib/ngrokapi/client.rb +218 -49
  222. data/lib/ngrokapi/models/abuse_report.rb +37 -0
  223. data/lib/ngrokapi/models/abuse_report_hostname.rb +27 -0
  224. data/lib/ngrokapi/models/api_key.rb +62 -64
  225. data/lib/ngrokapi/models/aws_auth.rb +27 -0
  226. data/lib/ngrokapi/models/aws_credentials.rb +27 -0
  227. data/lib/ngrokapi/models/aws_role.rb +25 -0
  228. data/lib/ngrokapi/models/certificate_authority.rb +72 -0
  229. data/lib/ngrokapi/models/credential.rb +67 -0
  230. data/lib/ngrokapi/models/endpoint_circuit_breaker.rb +35 -0
  231. data/lib/ngrokapi/models/endpoint_compression.rb +25 -0
  232. data/lib/ngrokapi/models/endpoint_configuration.rb +130 -119
  233. data/lib/ngrokapi/models/endpoint_ip_policy.rb +27 -0
  234. data/lib/ngrokapi/models/endpoint_ip_policy_mutate.rb +27 -0
  235. data/lib/ngrokapi/models/endpoint_logging.rb +27 -0
  236. data/lib/ngrokapi/models/endpoint_logging_mutate.rb +27 -0
  237. data/lib/ngrokapi/models/endpoint_mutual_tls.rb +27 -0
  238. data/lib/ngrokapi/models/endpoint_mutual_tls_mutate.rb +27 -0
  239. data/lib/ngrokapi/models/endpoint_o_auth.rb +37 -0
  240. data/lib/ngrokapi/models/endpoint_o_auth_facebook.rb +33 -0
  241. data/lib/ngrokapi/models/endpoint_o_auth_git_hub.rb +37 -0
  242. data/lib/ngrokapi/models/endpoint_o_auth_google.rb +33 -0
  243. data/lib/ngrokapi/models/endpoint_o_auth_microsoft.rb +33 -0
  244. data/lib/ngrokapi/models/endpoint_o_auth_provider.rb +31 -0
  245. data/lib/ngrokapi/models/endpoint_oidc.rb +41 -0
  246. data/lib/ngrokapi/models/endpoint_request_headers.rb +29 -0
  247. data/lib/ngrokapi/models/endpoint_response_headers.rb +29 -0
  248. data/lib/ngrokapi/models/endpoint_saml.rb +55 -0
  249. data/lib/ngrokapi/models/endpoint_saml_mutate.rb +45 -0
  250. data/lib/ngrokapi/models/endpoint_tls_termination.rb +29 -0
  251. data/lib/ngrokapi/models/endpoint_webhook_validation.rb +29 -0
  252. data/lib/ngrokapi/models/event_destination.rb +49 -0
  253. data/lib/ngrokapi/models/event_source.rb +31 -0
  254. data/lib/ngrokapi/models/event_source_replace.rb +29 -0
  255. data/lib/ngrokapi/models/event_stream.rb +77 -0
  256. data/lib/ngrokapi/models/event_subscription.rb +47 -0
  257. data/lib/ngrokapi/models/event_target.rb +31 -0
  258. data/lib/ngrokapi/models/event_target_cloudwatch_logs.rb +27 -0
  259. data/lib/ngrokapi/models/event_target_firehose.rb +27 -0
  260. data/lib/ngrokapi/models/event_target_kinesis.rb +27 -0
  261. data/lib/ngrokapi/models/ip_policy.rb +64 -0
  262. data/lib/ngrokapi/models/ip_policy_rule.rb +67 -0
  263. data/lib/ngrokapi/models/ip_restriction.rb +49 -0
  264. data/lib/ngrokapi/models/ip_whitelist_entry.rb +62 -0
  265. data/lib/ngrokapi/models/ref.rb +27 -0
  266. data/lib/ngrokapi/models/reserved_addr.rb +49 -0
  267. data/lib/ngrokapi/models/reserved_domain.rb +59 -211
  268. data/lib/ngrokapi/models/reserved_domain_cert_job.rb +33 -0
  269. data/lib/ngrokapi/models/reserved_domain_cert_ns_target.rb +27 -0
  270. data/lib/ngrokapi/models/reserved_domain_cert_policy.rb +27 -0
  271. data/lib/ngrokapi/models/reserved_domain_cert_status.rb +27 -0
  272. data/lib/ngrokapi/models/ssh_certificate_authority.rb +64 -0
  273. data/lib/ngrokapi/models/ssh_credential.rb +67 -0
  274. data/lib/ngrokapi/models/ssh_host_certificate.rb +74 -0
  275. data/lib/ngrokapi/models/ssh_user_certificate.rb +78 -0
  276. data/lib/ngrokapi/models/tls_certificate.rb +92 -62
  277. data/lib/ngrokapi/models/tls_certificate_sa_ns.rb +27 -0
  278. data/lib/ngrokapi/models/tunnel.rb +37 -0
  279. data/lib/ngrokapi/models/tunnel_session.rb +43 -0
  280. data/lib/ngrokapi/services/.gitkeep +0 -0
  281. data/lib/ngrokapi/services/abuse_reports_client.rb +84 -0
  282. data/lib/ngrokapi/services/api_keys_client.rb +203 -144
  283. data/lib/ngrokapi/services/certificate_authorities_client.rb +204 -0
  284. data/lib/ngrokapi/services/credentials_client.rb +212 -0
  285. data/lib/ngrokapi/services/endpoint_circuit_breaker_module_client.rb +122 -0
  286. data/lib/ngrokapi/services/endpoint_compression_module_client.rb +122 -0
  287. data/lib/ngrokapi/services/endpoint_configurations_client.rb +324 -313
  288. data/lib/ngrokapi/services/endpoint_ip_policy_module_client.rb +122 -0
  289. data/lib/ngrokapi/services/endpoint_logging_module_client.rb +122 -0
  290. data/lib/ngrokapi/services/endpoint_mutual_tls_module_client.rb +122 -0
  291. data/lib/ngrokapi/services/endpoint_o_auth_module_client.rb +122 -0
  292. data/lib/ngrokapi/services/endpoint_oidc_module_client.rb +122 -0
  293. data/lib/ngrokapi/services/endpoint_request_headers_module_client.rb +122 -0
  294. data/lib/ngrokapi/services/endpoint_response_headers_module_client.rb +122 -0
  295. data/lib/ngrokapi/services/endpoint_saml_module_client.rb +122 -0
  296. data/lib/ngrokapi/services/endpoint_tls_termination_module_client.rb +122 -0
  297. data/lib/ngrokapi/services/endpoint_webhook_validation_module_client.rb +122 -0
  298. data/lib/ngrokapi/services/event_destinations_client.rb +222 -0
  299. data/lib/ngrokapi/services/event_sources_client.rb +177 -0
  300. data/lib/ngrokapi/services/event_streams_client.rb +226 -0
  301. data/lib/ngrokapi/services/event_subscriptions_client.rb +213 -0
  302. data/lib/ngrokapi/services/ip_policies_client.rb +208 -0
  303. data/lib/ngrokapi/services/ip_policy_rules_client.rb +210 -0
  304. data/lib/ngrokapi/services/ip_restrictions_client.rb +223 -0
  305. data/lib/ngrokapi/services/ip_whitelist_client.rb +202 -0
  306. data/lib/ngrokapi/services/reserved_addrs_client.rb +246 -0
  307. data/lib/ngrokapi/services/reserved_domains_client.rb +382 -313
  308. data/lib/ngrokapi/services/ssh_certificate_authorities_client.rb +207 -0
  309. data/lib/ngrokapi/services/ssh_credentials_client.rb +211 -0
  310. data/lib/ngrokapi/services/ssh_host_certificates_client.rb +214 -0
  311. data/lib/ngrokapi/services/ssh_user_certificates_client.rb +220 -0
  312. data/lib/ngrokapi/services/tls_certificates_client.rb +207 -161
  313. data/lib/ngrokapi/services/tunnel_sessions_client.rb +228 -0
  314. data/lib/ngrokapi/services/tunnels_client.rb +51 -0
  315. data/lib/ngrokapi/version.rb +1 -1
  316. data/spec/ngrokapi/client_spec.rb +139 -33
  317. data/spec/ngrokapi/models/abuse_report_hostname_spec.rb +21 -0
  318. data/spec/ngrokapi/models/abuse_report_spec.rb +21 -0
  319. data/spec/ngrokapi/models/api_key_spec.rb +42 -43
  320. data/spec/ngrokapi/models/aws_auth_spec.rb +21 -0
  321. data/spec/ngrokapi/models/aws_credentials_spec.rb +21 -0
  322. data/spec/ngrokapi/models/aws_role_spec.rb +21 -0
  323. data/spec/ngrokapi/models/certificate_authority_spec.rb +42 -0
  324. data/spec/ngrokapi/models/credential_spec.rb +45 -0
  325. data/spec/ngrokapi/models/endpoint_circuit_breaker_spec.rb +21 -0
  326. data/spec/ngrokapi/models/endpoint_compression_spec.rb +21 -0
  327. data/spec/ngrokapi/models/endpoint_configuration_spec.rb +78 -0
  328. data/spec/ngrokapi/models/endpoint_ip_policy_mutate_spec.rb +21 -0
  329. data/spec/ngrokapi/models/endpoint_ip_policy_spec.rb +21 -0
  330. data/spec/ngrokapi/models/endpoint_logging_mutate_spec.rb +21 -0
  331. data/spec/ngrokapi/models/endpoint_logging_spec.rb +21 -0
  332. data/spec/ngrokapi/models/endpoint_mutual_tls_mutate_spec.rb +21 -0
  333. data/spec/ngrokapi/models/endpoint_mutual_tls_spec.rb +21 -0
  334. data/spec/ngrokapi/models/endpoint_o_auth_facebook_spec.rb +21 -0
  335. data/spec/ngrokapi/models/endpoint_o_auth_git_hub_spec.rb +21 -0
  336. data/spec/ngrokapi/models/endpoint_o_auth_google_spec.rb +21 -0
  337. data/spec/ngrokapi/models/endpoint_o_auth_microsoft_spec.rb +21 -0
  338. data/spec/ngrokapi/models/endpoint_o_auth_provider_spec.rb +21 -0
  339. data/spec/ngrokapi/models/endpoint_o_auth_spec.rb +21 -0
  340. data/spec/ngrokapi/models/endpoint_oidc_spec.rb +21 -0
  341. data/spec/ngrokapi/models/endpoint_request_headers_spec.rb +21 -0
  342. data/spec/ngrokapi/models/endpoint_response_headers_spec.rb +21 -0
  343. data/spec/ngrokapi/models/endpoint_saml_mutate_spec.rb +21 -0
  344. data/spec/ngrokapi/models/endpoint_saml_spec.rb +21 -0
  345. data/spec/ngrokapi/models/endpoint_tls_termination_spec.rb +21 -0
  346. data/spec/ngrokapi/models/endpoint_webhook_validation_spec.rb +21 -0
  347. data/spec/ngrokapi/models/event_destination_spec.rb +28 -0
  348. data/spec/ngrokapi/models/event_source_replace_spec.rb +21 -0
  349. data/spec/ngrokapi/models/event_source_spec.rb +21 -0
  350. data/spec/ngrokapi/models/event_stream_spec.rb +51 -0
  351. data/spec/ngrokapi/models/event_subscription_spec.rb +28 -0
  352. data/spec/ngrokapi/models/event_target_cloudwatch_logs_spec.rb +21 -0
  353. data/spec/ngrokapi/models/event_target_firehose_spec.rb +21 -0
  354. data/spec/ngrokapi/models/event_target_kinesis_spec.rb +21 -0
  355. data/spec/ngrokapi/models/event_target_spec.rb +21 -0
  356. data/spec/ngrokapi/models/ip_policy_rule_spec.rb +45 -0
  357. data/spec/ngrokapi/models/ip_policy_spec.rb +42 -0
  358. data/spec/ngrokapi/models/ip_restriction_spec.rb +28 -0
  359. data/spec/ngrokapi/models/ip_whitelist_entry_spec.rb +42 -0
  360. data/spec/ngrokapi/models/listable_spec.rb +4 -4
  361. data/spec/ngrokapi/models/ref_spec.rb +21 -0
  362. data/spec/ngrokapi/models/reserved_addr_spec.rb +28 -0
  363. data/spec/ngrokapi/models/reserved_domain_cert_job_spec.rb +21 -0
  364. data/spec/ngrokapi/models/reserved_domain_cert_ns_target_spec.rb +21 -0
  365. data/spec/ngrokapi/models/reserved_domain_cert_policy_spec.rb +21 -0
  366. data/spec/ngrokapi/models/reserved_domain_cert_status_spec.rb +21 -0
  367. data/spec/ngrokapi/models/reserved_domain_spec.rb +28 -100
  368. data/spec/ngrokapi/models/ssh_certificate_authority_spec.rb +42 -0
  369. data/spec/ngrokapi/models/ssh_credential_spec.rb +45 -0
  370. data/spec/ngrokapi/models/ssh_host_certificate_spec.rb +42 -0
  371. data/spec/ngrokapi/models/ssh_user_certificate_spec.rb +42 -0
  372. data/spec/ngrokapi/models/tls_certificate_sa_ns_spec.rb +21 -0
  373. data/spec/ngrokapi/models/tls_certificate_spec.rb +42 -0
  374. data/spec/ngrokapi/models/tunnel_session_spec.rb +21 -0
  375. data/spec/ngrokapi/models/tunnel_spec.rb +21 -0
  376. data/spec/ngrokapi/paged_iterator_spec.rb +5 -5
  377. data/spec/ngrokapi/services/.gitkeep +0 -0
  378. data/spec/ngrokapi/services/abuse_reports_client_spec.rb +67 -0
  379. data/spec/ngrokapi/services/api_keys_client_spec.rb +160 -127
  380. data/spec/ngrokapi/services/certificate_authorities_client_spec.rb +162 -0
  381. data/spec/ngrokapi/services/credentials_client_spec.rb +166 -0
  382. data/spec/ngrokapi/services/endpoint_circuit_breaker_module_client_spec.rb +127 -0
  383. data/spec/ngrokapi/services/endpoint_compression_module_client_spec.rb +127 -0
  384. data/spec/ngrokapi/services/endpoint_configurations_client_spec.rb +240 -0
  385. data/spec/ngrokapi/services/endpoint_ip_policy_module_client_spec.rb +127 -0
  386. data/spec/ngrokapi/services/endpoint_logging_module_client_spec.rb +127 -0
  387. data/spec/ngrokapi/services/endpoint_mutual_tls_module_client_spec.rb +127 -0
  388. data/spec/ngrokapi/services/endpoint_o_auth_module_client_spec.rb +127 -0
  389. data/spec/ngrokapi/services/endpoint_oidc_module_client_spec.rb +127 -0
  390. data/spec/ngrokapi/services/endpoint_request_headers_module_client_spec.rb +127 -0
  391. data/spec/ngrokapi/services/endpoint_response_headers_module_client_spec.rb +127 -0
  392. data/spec/ngrokapi/services/endpoint_saml_module_client_spec.rb +127 -0
  393. data/spec/ngrokapi/services/endpoint_tls_termination_module_client_spec.rb +127 -0
  394. data/spec/ngrokapi/services/endpoint_webhook_validation_module_client_spec.rb +127 -0
  395. data/spec/ngrokapi/services/event_destinations_client_spec.rb +175 -0
  396. data/spec/ngrokapi/services/event_sources_client_spec.rb +162 -0
  397. data/spec/ngrokapi/services/event_streams_client_spec.rb +180 -0
  398. data/spec/ngrokapi/services/event_subscriptions_client_spec.rb +172 -0
  399. data/spec/ngrokapi/services/ip_policies_client_spec.rb +162 -0
  400. data/spec/ngrokapi/services/ip_policy_rules_client_spec.rb +168 -0
  401. data/spec/ngrokapi/services/ip_restrictions_client_spec.rb +174 -0
  402. data/spec/ngrokapi/services/ip_whitelist_client_spec.rb +162 -0
  403. data/spec/ngrokapi/services/reserved_addrs_client_spec.rb +209 -0
  404. data/spec/ngrokapi/services/reserved_domains_client_spec.rb +352 -0
  405. data/spec/ngrokapi/services/ssh_certificate_authorities_client_spec.rb +166 -0
  406. data/spec/ngrokapi/services/ssh_credentials_client_spec.rb +168 -0
  407. data/spec/ngrokapi/services/ssh_host_certificates_client_spec.rb +170 -0
  408. data/spec/ngrokapi/services/ssh_user_certificates_client_spec.rb +174 -0
  409. data/spec/ngrokapi/services/tls_certificates_client_spec.rb +164 -0
  410. data/spec/ngrokapi/services/tunnel_sessions_client_spec.rb +184 -0
  411. data/spec/ngrokapi/services/tunnels_client_spec.rb +21 -0
  412. data/spec/spec_helper.rb +958 -0
  413. metadata +355 -10
@@ -0,0 +1,168 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe NgrokAPI::Services::IPPolicyRulesClient do
4
+ let(:base_url) { 'https://api.ngrok.com' }
5
+ let(:path) { '/ip_policy_rules' }
6
+ let(:not_found) do
7
+ NgrokAPI::Errors::NotFoundError.new(response: ip_policy_rule_result)
8
+ end
9
+
10
+ before(:each) do
11
+ @client = class_double("HttpClient")
12
+ @ip_policy_rules_client = NgrokAPI::Services::IPPolicyRulesClient.new(client: @client)
13
+ end
14
+
15
+ describe "#create" do
16
+ it "will make a post request and return an instance of NgrokAPI::Models::IPPolicyRule" do
17
+ path = '/ip_policy_rules'
18
+ replacements = {
19
+ }
20
+ data = {}
21
+ data[:description] = "New description"
22
+ data[:metadata] = "New metadata"
23
+ data[:cidr] = "New cidr"
24
+ data[:ip_policy_id] = "New ip_policy_id"
25
+ expect(@client).to receive(:post).with(path % replacements, data: data).
26
+ and_return(ip_policy_rule_result)
27
+ result = @ip_policy_rules_client.create(
28
+ description: "New description",
29
+ metadata: "New metadata",
30
+ cidr: "New cidr",
31
+ ip_policy_id: "New ip_policy_id"
32
+ )
33
+ expect(result.class).to eq(NgrokAPI::Models::IPPolicyRule)
34
+ # expect(result.id).to eq(ip_policy_rule_result["id"])
35
+ end
36
+ end
37
+
38
+ describe "#delete" do
39
+ it "will make a delete request" do
40
+ path = '/ip_policy_rules/%{id}'
41
+ replacements = {
42
+ id: api_key_result["id"],
43
+ }
44
+ expect(@client).to receive(:delete).with(path % replacements).and_return(nil)
45
+ @ip_policy_rules_client.delete(
46
+ id: api_key_result["id"]
47
+ )
48
+ end
49
+ end
50
+
51
+ describe "#delete!" do
52
+ it "will make a delete request" do
53
+ path = '/ip_policy_rules/%{id}'
54
+ replacements = {
55
+ id: api_key_result["id"],
56
+ }
57
+ expect(@client).to receive(:delete).with(path % replacements, danger: true).and_return(nil)
58
+ @ip_policy_rules_client.delete!(
59
+ id: api_key_result["id"]
60
+ )
61
+ end
62
+
63
+ it "will make a delete request and return NotFoundError if 404" do
64
+ path = '/ip_policy_rules/%{id}'
65
+ replacements = {
66
+ id: api_key_result["id"],
67
+ }
68
+ expect do
69
+ expect(@client).to receive(:delete).with(path % replacements, danger: true).
70
+ and_raise(NgrokAPI::Errors::NotFoundError)
71
+ result = @ip_policy_rules_client.delete!(
72
+ id: api_key_result["id"]
73
+ )
74
+ expect(result).to be nil
75
+ end.to raise_error(NgrokAPI::Errors::NotFoundError)
76
+ end
77
+ end
78
+
79
+ describe "#get" do
80
+ it "will make a get request and return an instance of NgrokAPI::Models::IPPolicyRule" do
81
+ path = '/ip_policy_rules/%{id}'
82
+ replacements = {
83
+ id: ip_policy_rule_result["id"],
84
+ }
85
+ data = {}
86
+ expect(@client).to receive(:get).with(path % replacements, data: data).
87
+ and_return(ip_policy_rule_result)
88
+ result = @ip_policy_rules_client.get(
89
+ id: ip_policy_rule_result["id"]
90
+ )
91
+ expect(result.class).to eq(NgrokAPI::Models::IPPolicyRule)
92
+ # expect(result.id).to eq(ip_policy_rule_result["id"])
93
+ end
94
+ end
95
+
96
+ describe "#get!" do
97
+ it "will make a get request and return an instance of NgrokAPI::Models::IPPolicyRule" do
98
+ path = '/ip_policy_rules/%{id}'
99
+ replacements = {
100
+ id: ip_policy_rule_result["id"],
101
+ }
102
+ data = {}
103
+ expect(@client).to receive(:get).with(path % replacements, data: data).
104
+ and_return(ip_policy_rule_result)
105
+ result = @ip_policy_rules_client.get(
106
+ id: ip_policy_rule_result["id"]
107
+ )
108
+ expect(result.class).to eq(NgrokAPI::Models::IPPolicyRule)
109
+ # expect(result.id).to eq(ip_policy_rule_result["id"])
110
+ end
111
+ end
112
+
113
+ describe "#list" do
114
+ it "will make a call to list (a GET request) and return a NgrokAPI::Models::Listable" do
115
+ expect(@client).to receive(:list).
116
+ and_return(ip_policy_rule_results)
117
+ url = base_url + path + "?before_id=" + api_key_result["id"] + "&limit=1"
118
+ result = @ip_policy_rules_client.list(url: url)
119
+ expect(result.class).to eq(NgrokAPI::Models::Listable)
120
+ end
121
+ end
122
+
123
+ describe "#update" do
124
+ it "will make a patch request and return an instance of NgrokAPI::Models::IPPolicyRule" do
125
+ path = '/ip_policy_rules/%{id}'
126
+ replacements = {
127
+ id: ip_policy_rule_result["id"],
128
+ }
129
+ data = {}
130
+ data[:description] = "New description"
131
+ data[:metadata] = "New metadata"
132
+ data[:cidr] = "New cidr"
133
+ expect(@client).to receive(:patch).with(path % replacements, data: data).
134
+ and_return(ip_policy_rule_result)
135
+ result = @ip_policy_rules_client.update(
136
+ id: ip_policy_rule_result["id"],
137
+ description: "New description",
138
+ metadata: "New metadata",
139
+ cidr: "New cidr"
140
+ )
141
+ expect(result.class).to eq(NgrokAPI::Models::IPPolicyRule)
142
+ # expect(result.id).to eq(ip_policy_rule_result["id"])
143
+ end
144
+ end
145
+
146
+ describe "#update!" do
147
+ it "will make a patch request and return an instance of NgrokAPI::Models::IPPolicyRule" do
148
+ path = '/ip_policy_rules/%{id}'
149
+ replacements = {
150
+ id: ip_policy_rule_result["id"],
151
+ }
152
+ data = {}
153
+ data[:description] = "New description"
154
+ data[:metadata] = "New metadata"
155
+ data[:cidr] = "New cidr"
156
+ expect(@client).to receive(:patch).with(path % replacements, data: data).
157
+ and_return(ip_policy_rule_result)
158
+ result = @ip_policy_rules_client.update(
159
+ id: ip_policy_rule_result["id"],
160
+ description: "New description",
161
+ metadata: "New metadata",
162
+ cidr: "New cidr"
163
+ )
164
+ expect(result.class).to eq(NgrokAPI::Models::IPPolicyRule)
165
+ # expect(result.id).to eq(ip_policy_rule_result["id"])
166
+ end
167
+ end
168
+ end
@@ -0,0 +1,174 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe NgrokAPI::Services::IPRestrictionsClient do
4
+ let(:base_url) { 'https://api.ngrok.com' }
5
+ let(:path) { '/ip_restrictions' }
6
+ let(:not_found) do
7
+ NgrokAPI::Errors::NotFoundError.new(response: ip_restriction_result)
8
+ end
9
+
10
+ before(:each) do
11
+ @client = class_double("HttpClient")
12
+ @ip_restrictions_client = NgrokAPI::Services::IPRestrictionsClient.new(client: @client)
13
+ end
14
+
15
+ describe "#create" do
16
+ it "will make a post request and return an instance of NgrokAPI::Models::IPRestriction" do
17
+ path = '/ip_restrictions'
18
+ replacements = {
19
+ }
20
+ data = {}
21
+ data[:description] = "New description"
22
+ data[:metadata] = "New metadata"
23
+ data[:enforced] = "New enforced"
24
+ data[:type] = "New type"
25
+ data[:ip_policy_ids] = "New ip_policy_ids"
26
+ expect(@client).to receive(:post).with(path % replacements, data: data).
27
+ and_return(ip_restriction_result)
28
+ result = @ip_restrictions_client.create(
29
+ description: "New description",
30
+ metadata: "New metadata",
31
+ enforced: "New enforced",
32
+ type: "New type",
33
+ ip_policy_ids: "New ip_policy_ids"
34
+ )
35
+ expect(result.class).to eq(NgrokAPI::Models::IPRestriction)
36
+ # expect(result.id).to eq(ip_restriction_result["id"])
37
+ end
38
+ end
39
+
40
+ describe "#delete" do
41
+ it "will make a delete request" do
42
+ path = '/ip_restrictions/%{id}'
43
+ replacements = {
44
+ id: api_key_result["id"],
45
+ }
46
+ expect(@client).to receive(:delete).with(path % replacements).and_return(nil)
47
+ @ip_restrictions_client.delete(
48
+ id: api_key_result["id"]
49
+ )
50
+ end
51
+ end
52
+
53
+ describe "#delete!" do
54
+ it "will make a delete request" do
55
+ path = '/ip_restrictions/%{id}'
56
+ replacements = {
57
+ id: api_key_result["id"],
58
+ }
59
+ expect(@client).to receive(:delete).with(path % replacements, danger: true).and_return(nil)
60
+ @ip_restrictions_client.delete!(
61
+ id: api_key_result["id"]
62
+ )
63
+ end
64
+
65
+ it "will make a delete request and return NotFoundError if 404" do
66
+ path = '/ip_restrictions/%{id}'
67
+ replacements = {
68
+ id: api_key_result["id"],
69
+ }
70
+ expect do
71
+ expect(@client).to receive(:delete).with(path % replacements, danger: true).
72
+ and_raise(NgrokAPI::Errors::NotFoundError)
73
+ result = @ip_restrictions_client.delete!(
74
+ id: api_key_result["id"]
75
+ )
76
+ expect(result).to be nil
77
+ end.to raise_error(NgrokAPI::Errors::NotFoundError)
78
+ end
79
+ end
80
+
81
+ describe "#get" do
82
+ it "will make a get request and return an instance of NgrokAPI::Models::IPRestriction" do
83
+ path = '/ip_restrictions/%{id}'
84
+ replacements = {
85
+ id: ip_restriction_result["id"],
86
+ }
87
+ data = {}
88
+ expect(@client).to receive(:get).with(path % replacements, data: data).
89
+ and_return(ip_restriction_result)
90
+ result = @ip_restrictions_client.get(
91
+ id: ip_restriction_result["id"]
92
+ )
93
+ expect(result.class).to eq(NgrokAPI::Models::IPRestriction)
94
+ # expect(result.id).to eq(ip_restriction_result["id"])
95
+ end
96
+ end
97
+
98
+ describe "#get!" do
99
+ it "will make a get request and return an instance of NgrokAPI::Models::IPRestriction" do
100
+ path = '/ip_restrictions/%{id}'
101
+ replacements = {
102
+ id: ip_restriction_result["id"],
103
+ }
104
+ data = {}
105
+ expect(@client).to receive(:get).with(path % replacements, data: data).
106
+ and_return(ip_restriction_result)
107
+ result = @ip_restrictions_client.get(
108
+ id: ip_restriction_result["id"]
109
+ )
110
+ expect(result.class).to eq(NgrokAPI::Models::IPRestriction)
111
+ # expect(result.id).to eq(ip_restriction_result["id"])
112
+ end
113
+ end
114
+
115
+ describe "#list" do
116
+ it "will make a call to list (a GET request) and return a NgrokAPI::Models::Listable" do
117
+ expect(@client).to receive(:list).
118
+ and_return(ip_restriction_results)
119
+ url = base_url + path + "?before_id=" + api_key_result["id"] + "&limit=1"
120
+ result = @ip_restrictions_client.list(url: url)
121
+ expect(result.class).to eq(NgrokAPI::Models::Listable)
122
+ end
123
+ end
124
+
125
+ describe "#update" do
126
+ it "will make a patch request and return an instance of NgrokAPI::Models::IPRestriction" do
127
+ path = '/ip_restrictions/%{id}'
128
+ replacements = {
129
+ id: ip_restriction_result["id"],
130
+ }
131
+ data = {}
132
+ data[:description] = "New description"
133
+ data[:metadata] = "New metadata"
134
+ data[:enforced] = "New enforced"
135
+ data[:ip_policy_ids] = "New ip_policy_ids"
136
+ expect(@client).to receive(:patch).with(path % replacements, data: data).
137
+ and_return(ip_restriction_result)
138
+ result = @ip_restrictions_client.update(
139
+ id: ip_restriction_result["id"],
140
+ description: "New description",
141
+ metadata: "New metadata",
142
+ enforced: "New enforced",
143
+ ip_policy_ids: "New ip_policy_ids"
144
+ )
145
+ expect(result.class).to eq(NgrokAPI::Models::IPRestriction)
146
+ # expect(result.id).to eq(ip_restriction_result["id"])
147
+ end
148
+ end
149
+
150
+ describe "#update!" do
151
+ it "will make a patch request and return an instance of NgrokAPI::Models::IPRestriction" do
152
+ path = '/ip_restrictions/%{id}'
153
+ replacements = {
154
+ id: ip_restriction_result["id"],
155
+ }
156
+ data = {}
157
+ data[:description] = "New description"
158
+ data[:metadata] = "New metadata"
159
+ data[:enforced] = "New enforced"
160
+ data[:ip_policy_ids] = "New ip_policy_ids"
161
+ expect(@client).to receive(:patch).with(path % replacements, data: data).
162
+ and_return(ip_restriction_result)
163
+ result = @ip_restrictions_client.update(
164
+ id: ip_restriction_result["id"],
165
+ description: "New description",
166
+ metadata: "New metadata",
167
+ enforced: "New enforced",
168
+ ip_policy_ids: "New ip_policy_ids"
169
+ )
170
+ expect(result.class).to eq(NgrokAPI::Models::IPRestriction)
171
+ # expect(result.id).to eq(ip_restriction_result["id"])
172
+ end
173
+ end
174
+ end
@@ -0,0 +1,162 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe NgrokAPI::Services::IPWhitelistClient do
4
+ let(:base_url) { 'https://api.ngrok.com' }
5
+ let(:path) { '/ip_whitelist' }
6
+ let(:not_found) do
7
+ NgrokAPI::Errors::NotFoundError.new(response: ip_whitelist_entry_result)
8
+ end
9
+
10
+ before(:each) do
11
+ @client = class_double("HttpClient")
12
+ @ip_whitelist_client = NgrokAPI::Services::IPWhitelistClient.new(client: @client)
13
+ end
14
+
15
+ describe "#create" do
16
+ it "will make a post request and return an instance of NgrokAPI::Models::IPWhitelistEntry" do
17
+ path = '/ip_whitelist'
18
+ replacements = {
19
+ }
20
+ data = {}
21
+ data[:description] = "New description"
22
+ data[:metadata] = "New metadata"
23
+ data[:ip_net] = "New ip_net"
24
+ expect(@client).to receive(:post).with(path % replacements, data: data).
25
+ and_return(ip_whitelist_entry_result)
26
+ result = @ip_whitelist_client.create(
27
+ description: "New description",
28
+ metadata: "New metadata",
29
+ ip_net: "New ip_net"
30
+ )
31
+ expect(result.class).to eq(NgrokAPI::Models::IPWhitelistEntry)
32
+ # expect(result.id).to eq(ip_whitelist_entry_result["id"])
33
+ end
34
+ end
35
+
36
+ describe "#delete" do
37
+ it "will make a delete request" do
38
+ path = '/ip_whitelist/%{id}'
39
+ replacements = {
40
+ id: api_key_result["id"],
41
+ }
42
+ expect(@client).to receive(:delete).with(path % replacements).and_return(nil)
43
+ @ip_whitelist_client.delete(
44
+ id: api_key_result["id"]
45
+ )
46
+ end
47
+ end
48
+
49
+ describe "#delete!" do
50
+ it "will make a delete request" do
51
+ path = '/ip_whitelist/%{id}'
52
+ replacements = {
53
+ id: api_key_result["id"],
54
+ }
55
+ expect(@client).to receive(:delete).with(path % replacements, danger: true).and_return(nil)
56
+ @ip_whitelist_client.delete!(
57
+ id: api_key_result["id"]
58
+ )
59
+ end
60
+
61
+ it "will make a delete request and return NotFoundError if 404" do
62
+ path = '/ip_whitelist/%{id}'
63
+ replacements = {
64
+ id: api_key_result["id"],
65
+ }
66
+ expect do
67
+ expect(@client).to receive(:delete).with(path % replacements, danger: true).
68
+ and_raise(NgrokAPI::Errors::NotFoundError)
69
+ result = @ip_whitelist_client.delete!(
70
+ id: api_key_result["id"]
71
+ )
72
+ expect(result).to be nil
73
+ end.to raise_error(NgrokAPI::Errors::NotFoundError)
74
+ end
75
+ end
76
+
77
+ describe "#get" do
78
+ it "will make a get request and return an instance of NgrokAPI::Models::IPWhitelistEntry" do
79
+ path = '/ip_whitelist/%{id}'
80
+ replacements = {
81
+ id: ip_whitelist_entry_result["id"],
82
+ }
83
+ data = {}
84
+ expect(@client).to receive(:get).with(path % replacements, data: data).
85
+ and_return(ip_whitelist_entry_result)
86
+ result = @ip_whitelist_client.get(
87
+ id: ip_whitelist_entry_result["id"]
88
+ )
89
+ expect(result.class).to eq(NgrokAPI::Models::IPWhitelistEntry)
90
+ # expect(result.id).to eq(ip_whitelist_entry_result["id"])
91
+ end
92
+ end
93
+
94
+ describe "#get!" do
95
+ it "will make a get request and return an instance of NgrokAPI::Models::IPWhitelistEntry" do
96
+ path = '/ip_whitelist/%{id}'
97
+ replacements = {
98
+ id: ip_whitelist_entry_result["id"],
99
+ }
100
+ data = {}
101
+ expect(@client).to receive(:get).with(path % replacements, data: data).
102
+ and_return(ip_whitelist_entry_result)
103
+ result = @ip_whitelist_client.get(
104
+ id: ip_whitelist_entry_result["id"]
105
+ )
106
+ expect(result.class).to eq(NgrokAPI::Models::IPWhitelistEntry)
107
+ # expect(result.id).to eq(ip_whitelist_entry_result["id"])
108
+ end
109
+ end
110
+
111
+ describe "#list" do
112
+ it "will make a call to list (a GET request) and return a NgrokAPI::Models::Listable" do
113
+ expect(@client).to receive(:list).
114
+ and_return(ip_whitelist_entry_results)
115
+ url = base_url + path + "?before_id=" + api_key_result["id"] + "&limit=1"
116
+ result = @ip_whitelist_client.list(url: url)
117
+ expect(result.class).to eq(NgrokAPI::Models::Listable)
118
+ end
119
+ end
120
+
121
+ describe "#update" do
122
+ it "will make a patch request and return an instance of NgrokAPI::Models::IPWhitelistEntry" do
123
+ path = '/ip_whitelist/%{id}'
124
+ replacements = {
125
+ id: ip_whitelist_entry_result["id"],
126
+ }
127
+ data = {}
128
+ data[:description] = "New description"
129
+ data[:metadata] = "New metadata"
130
+ expect(@client).to receive(:patch).with(path % replacements, data: data).
131
+ and_return(ip_whitelist_entry_result)
132
+ result = @ip_whitelist_client.update(
133
+ id: ip_whitelist_entry_result["id"],
134
+ description: "New description",
135
+ metadata: "New metadata"
136
+ )
137
+ expect(result.class).to eq(NgrokAPI::Models::IPWhitelistEntry)
138
+ # expect(result.id).to eq(ip_whitelist_entry_result["id"])
139
+ end
140
+ end
141
+
142
+ describe "#update!" do
143
+ it "will make a patch request and return an instance of NgrokAPI::Models::IPWhitelistEntry" do
144
+ path = '/ip_whitelist/%{id}'
145
+ replacements = {
146
+ id: ip_whitelist_entry_result["id"],
147
+ }
148
+ data = {}
149
+ data[:description] = "New description"
150
+ data[:metadata] = "New metadata"
151
+ expect(@client).to receive(:patch).with(path % replacements, data: data).
152
+ and_return(ip_whitelist_entry_result)
153
+ result = @ip_whitelist_client.update(
154
+ id: ip_whitelist_entry_result["id"],
155
+ description: "New description",
156
+ metadata: "New metadata"
157
+ )
158
+ expect(result.class).to eq(NgrokAPI::Models::IPWhitelistEntry)
159
+ # expect(result.id).to eq(ip_whitelist_entry_result["id"])
160
+ end
161
+ end
162
+ end