ngrok-api 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/NgrokAPI/Client.html +270 -180
- data/doc/NgrokAPI/Error.html +2 -2
- data/doc/NgrokAPI/Errors/NotFoundError.html +2 -2
- data/doc/NgrokAPI/Errors.html +2 -2
- data/doc/NgrokAPI/HttpClient.html +2 -2
- data/doc/NgrokAPI/Models/APIKey.html +2 -2
- data/doc/NgrokAPI/Models/AWSAuth.html +2 -2
- data/doc/NgrokAPI/Models/AWSCredentials.html +2 -2
- data/doc/NgrokAPI/Models/AWSRole.html +2 -2
- data/doc/NgrokAPI/Models/AbuseReport.html +2 -2
- data/doc/NgrokAPI/Models/AbuseReportHostname.html +2 -2
- data/doc/NgrokAPI/Models/AgentIngress.html +2 -2
- data/doc/NgrokAPI/Models/CertificateAuthority.html +2 -2
- data/doc/NgrokAPI/Models/Credential.html +2 -2
- data/doc/NgrokAPI/Models/Endpoint.html +1431 -0
- data/{docs/NgrokAPI/Models/EndpointLogging.html → doc/NgrokAPI/Models/EndpointBackend.html} +41 -41
- data/doc/NgrokAPI/Models/{EndpointLoggingMutate.html → EndpointBackendMutate.html} +41 -41
- data/doc/NgrokAPI/Models/EndpointCircuitBreaker.html +2 -2
- data/doc/NgrokAPI/Models/EndpointCompression.html +2 -2
- data/doc/NgrokAPI/Models/EndpointIPPolicy.html +2 -2
- data/doc/NgrokAPI/Models/EndpointIPPolicyMutate.html +2 -2
- data/doc/NgrokAPI/Models/EndpointMutualTLS.html +2 -2
- data/doc/NgrokAPI/Models/EndpointMutualTLSMutate.html +2 -2
- data/doc/NgrokAPI/Models/EndpointOAuth.html +2 -2
- data/doc/NgrokAPI/Models/EndpointOAuthFacebook.html +2 -2
- data/doc/NgrokAPI/Models/EndpointOAuthGitHub.html +2 -2
- data/doc/NgrokAPI/Models/EndpointOAuthGoogle.html +2 -2
- data/doc/NgrokAPI/Models/EndpointOAuthMicrosoft.html +2 -2
- data/doc/NgrokAPI/Models/EndpointOAuthProvider.html +2 -2
- data/doc/NgrokAPI/Models/EndpointOIDC.html +2 -2
- data/doc/NgrokAPI/Models/EndpointRequestHeaders.html +2 -2
- data/doc/NgrokAPI/Models/EndpointResponseHeaders.html +2 -2
- data/doc/NgrokAPI/Models/EndpointSAML.html +2 -2
- data/doc/NgrokAPI/Models/EndpointSAMLMutate.html +2 -2
- data/doc/NgrokAPI/Models/EndpointTLSTermination.html +2 -2
- data/doc/NgrokAPI/Models/EndpointTLSTerminationAtEdge.html +617 -0
- data/doc/NgrokAPI/Models/EndpointWebhookValidation.html +2 -2
- data/doc/NgrokAPI/Models/EndpointWebsocketTCPConverter.html +543 -0
- data/doc/NgrokAPI/Models/EventDestination.html +6 -6
- data/doc/NgrokAPI/Models/EventSource.html +2 -2
- data/doc/NgrokAPI/Models/EventSourceList.html +2 -2
- data/doc/NgrokAPI/Models/EventSourceReplace.html +2 -2
- data/doc/NgrokAPI/Models/EventSubscription.html +2 -2
- data/doc/NgrokAPI/Models/EventTarget.html +2 -2
- data/doc/NgrokAPI/Models/EventTargetCloudwatchLogs.html +2 -2
- data/doc/NgrokAPI/Models/EventTargetFirehose.html +2 -2
- data/doc/NgrokAPI/Models/EventTargetKinesis.html +2 -2
- data/doc/NgrokAPI/Models/FailoverBackend.html +1075 -0
- data/doc/NgrokAPI/Models/HTTPResponseBackend.html +1231 -0
- data/{docs/NgrokAPI/Models/EventStream.html → doc/NgrokAPI/Models/HTTPSEdge.html} +118 -118
- data/doc/NgrokAPI/Models/{EndpointConfiguration.html → HTTPSEdgeRoute.html} +202 -264
- data/doc/NgrokAPI/Models/IPPolicy.html +2 -2
- data/doc/NgrokAPI/Models/IPPolicyRule.html +96 -22
- data/doc/NgrokAPI/Models/IPRestriction.html +2 -2
- data/doc/NgrokAPI/Models/Listable.html +2 -2
- data/doc/NgrokAPI/Models/Ref.html +2 -2
- data/doc/NgrokAPI/Models/ReservedAddr.html +2 -2
- data/doc/NgrokAPI/Models/ReservedDomain.html +2 -2
- data/doc/NgrokAPI/Models/ReservedDomainCertJob.html +2 -2
- data/doc/NgrokAPI/Models/ReservedDomainCertPolicy.html +2 -2
- data/doc/NgrokAPI/Models/ReservedDomainCertStatus.html +2 -2
- data/doc/NgrokAPI/Models/SSHCertificateAuthority.html +2 -2
- data/doc/NgrokAPI/Models/SSHCredential.html +2 -2
- data/doc/NgrokAPI/Models/SSHHostCertificate.html +2 -2
- data/doc/NgrokAPI/Models/SSHUserCertificate.html +2 -2
- data/doc/NgrokAPI/Models/TCPEdge.html +1235 -0
- data/doc/NgrokAPI/Models/TLSCertificate.html +2 -2
- data/doc/NgrokAPI/Models/TLSCertificateSANs.html +2 -2
- data/doc/NgrokAPI/Models/TLSEdge.html +1395 -0
- data/doc/NgrokAPI/Models/Tunnel.html +313 -17
- data/doc/NgrokAPI/Models/TunnelGroupBackend.html +1149 -0
- data/doc/NgrokAPI/Models/TunnelSession.html +2 -2
- data/doc/NgrokAPI/Models/WeightedBackend.html +1075 -0
- data/doc/NgrokAPI/Models.html +4 -4
- data/doc/NgrokAPI/PagedIterator.html +2 -2
- data/doc/NgrokAPI/Services/APIKeysClient.html +2 -2
- data/doc/NgrokAPI/Services/AbuseReportsClient.html +2 -2
- data/doc/NgrokAPI/Services/AgentIngressesClient.html +2 -2
- data/doc/NgrokAPI/Services/CertificateAuthoritiesClient.html +2 -2
- data/doc/NgrokAPI/Services/CredentialsClient.html +2 -2
- data/doc/NgrokAPI/Services/EdgeRouteBackendModuleClient.html +1153 -0
- data/doc/NgrokAPI/Services/{EndpointCircuitBreakerModuleClient.html → EdgeRouteCircuitBreakerModuleClient.html} +206 -96
- data/{docs/NgrokAPI/Services/EndpointCompressionModuleClient.html → doc/NgrokAPI/Services/EdgeRouteCompressionModuleClient.html} +206 -96
- data/doc/NgrokAPI/Services/EdgeRouteIPRestrictionModuleClient.html +1153 -0
- data/doc/NgrokAPI/Services/EdgeRouteOAuthModuleClient.html +1153 -0
- data/{docs/NgrokAPI/Services/EndpointOIDCModuleClient.html → doc/NgrokAPI/Services/EdgeRouteOIDCModuleClient.html} +206 -96
- data/doc/NgrokAPI/Services/EdgeRouteRequestHeadersModuleClient.html +1153 -0
- data/{docs/NgrokAPI/Services/EndpointResponseHeadersModuleClient.html → doc/NgrokAPI/Services/EdgeRouteResponseHeadersModuleClient.html} +206 -96
- data/{docs/NgrokAPI/Services/EndpointSAMLModuleClient.html → doc/NgrokAPI/Services/EdgeRouteSAMLModuleClient.html} +206 -96
- data/doc/NgrokAPI/Services/{EndpointWebhookValidationModuleClient.html → EdgeRouteWebhookVerificationModuleClient.html} +206 -96
- data/doc/NgrokAPI/Services/EdgeRouteWebsocketTCPConverterModuleClient.html +1153 -0
- data/doc/NgrokAPI/Services/{EventStreamsClient.html → EdgesHTTPSClient.html} +236 -271
- data/{docs/NgrokAPI/Services/EndpointConfigurationsClient.html → doc/NgrokAPI/Services/EdgesHTTPSRoutesClient.html} +456 -620
- data/doc/NgrokAPI/Services/EdgesTCPClient.html +1757 -0
- data/doc/NgrokAPI/Services/EdgesTLSClient.html +1847 -0
- data/doc/NgrokAPI/Services/EndpointsClient.html +907 -0
- data/doc/NgrokAPI/Services/EventDestinationsClient.html +35 -35
- data/doc/NgrokAPI/Services/EventSourcesClient.html +2 -2
- data/doc/NgrokAPI/Services/EventSubscriptionsClient.html +5 -5
- data/doc/NgrokAPI/Services/FailoverBackendsClient.html +1644 -0
- data/doc/NgrokAPI/Services/HTTPResponseBackendsClient.html +1744 -0
- data/doc/NgrokAPI/Services/{EndpointOIDCModuleClient.html → HTTPSEdgeMutualTLSModuleClient.html} +59 -59
- data/doc/NgrokAPI/Services/{EndpointRequestHeadersModuleClient.html → HTTPSEdgeTLSTerminationModuleClient.html} +59 -59
- data/doc/NgrokAPI/Services/IPPoliciesClient.html +40 -58
- data/doc/NgrokAPI/Services/IPPolicyRulesClient.html +60 -40
- data/doc/NgrokAPI/Services/IPRestrictionsClient.html +3 -3
- data/doc/NgrokAPI/Services/ReservedAddrsClient.html +41 -331
- data/doc/NgrokAPI/Services/ReservedDomainsClient.html +94 -674
- data/doc/NgrokAPI/Services/SSHCertificateAuthoritiesClient.html +2 -2
- data/doc/NgrokAPI/Services/SSHCredentialsClient.html +2 -2
- data/doc/NgrokAPI/Services/SSHHostCertificatesClient.html +2 -2
- data/doc/NgrokAPI/Services/SSHUserCertificatesClient.html +2 -2
- data/{docs/NgrokAPI/Services/EndpointLoggingModuleClient.html → doc/NgrokAPI/Services/TCPEdgeBackendModuleClient.html} +59 -59
- data/doc/NgrokAPI/Services/{EndpointIPPolicyModuleClient.html → TCPEdgeIPRestrictionModuleClient.html} +41 -41
- data/doc/NgrokAPI/Services/TLSCertificatesClient.html +2 -2
- data/doc/NgrokAPI/Services/{EndpointLoggingModuleClient.html → TLSEdgeBackendModuleClient.html} +59 -59
- data/{docs/NgrokAPI/Services/EndpointIPPolicyModuleClient.html → doc/NgrokAPI/Services/TLSEdgeIPRestrictionModuleClient.html} +41 -41
- data/doc/NgrokAPI/Services/{EndpointMutualTLSModuleClient.html → TLSEdgeMutualTLSModuleClient.html} +41 -41
- data/{docs/NgrokAPI/Services/EndpointTLSTerminationModuleClient.html → doc/NgrokAPI/Services/TLSEdgeTLSTerminationModuleClient.html} +41 -41
- data/doc/NgrokAPI/Services/TunnelGroupBackendsClient.html +1644 -0
- data/doc/NgrokAPI/Services/TunnelSessionsClient.html +2 -2
- data/doc/NgrokAPI/Services/TunnelsClient.html +241 -3
- data/doc/NgrokAPI/Services/WeightedBackendsClient.html +1644 -0
- data/doc/NgrokAPI/Services.html +4 -4
- data/doc/NgrokAPI.html +3 -3
- data/doc/_index.html +237 -60
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +2 -2
- data/doc/index.html +2 -2
- data/doc/method_list.html +3393 -1433
- data/doc/top-level-namespace.html +2 -2
- data/docs/NgrokAPI/Client.html +270 -180
- data/docs/NgrokAPI/Error.html +2 -2
- data/docs/NgrokAPI/Errors/NotFoundError.html +2 -2
- data/docs/NgrokAPI/Errors.html +2 -2
- data/docs/NgrokAPI/HttpClient.html +2 -2
- data/docs/NgrokAPI/Models/APIKey.html +2 -2
- data/docs/NgrokAPI/Models/AWSAuth.html +2 -2
- data/docs/NgrokAPI/Models/AWSCredentials.html +2 -2
- data/docs/NgrokAPI/Models/AWSRole.html +2 -2
- data/docs/NgrokAPI/Models/AbuseReport.html +2 -2
- data/docs/NgrokAPI/Models/AbuseReportHostname.html +2 -2
- data/docs/NgrokAPI/Models/AgentIngress.html +2 -2
- data/docs/NgrokAPI/Models/CertificateAuthority.html +2 -2
- data/docs/NgrokAPI/Models/Credential.html +2 -2
- data/docs/NgrokAPI/Models/Endpoint.html +1431 -0
- data/{doc/NgrokAPI/Models/EndpointLogging.html → docs/NgrokAPI/Models/EndpointBackend.html} +41 -41
- data/docs/NgrokAPI/Models/{EndpointLoggingMutate.html → EndpointBackendMutate.html} +41 -41
- data/docs/NgrokAPI/Models/EndpointCircuitBreaker.html +2 -2
- data/docs/NgrokAPI/Models/EndpointCompression.html +2 -2
- data/docs/NgrokAPI/Models/EndpointIPPolicy.html +2 -2
- data/docs/NgrokAPI/Models/EndpointIPPolicyMutate.html +2 -2
- data/docs/NgrokAPI/Models/EndpointMutualTLS.html +2 -2
- data/docs/NgrokAPI/Models/EndpointMutualTLSMutate.html +2 -2
- data/docs/NgrokAPI/Models/EndpointOAuth.html +2 -2
- data/docs/NgrokAPI/Models/EndpointOAuthFacebook.html +2 -2
- data/docs/NgrokAPI/Models/EndpointOAuthGitHub.html +2 -2
- data/docs/NgrokAPI/Models/EndpointOAuthGoogle.html +2 -2
- data/docs/NgrokAPI/Models/EndpointOAuthMicrosoft.html +2 -2
- data/docs/NgrokAPI/Models/EndpointOAuthProvider.html +2 -2
- data/docs/NgrokAPI/Models/EndpointOIDC.html +2 -2
- data/docs/NgrokAPI/Models/EndpointRequestHeaders.html +2 -2
- data/docs/NgrokAPI/Models/EndpointResponseHeaders.html +2 -2
- data/docs/NgrokAPI/Models/EndpointSAML.html +2 -2
- data/docs/NgrokAPI/Models/EndpointSAMLMutate.html +2 -2
- data/docs/NgrokAPI/Models/EndpointTLSTermination.html +2 -2
- data/docs/NgrokAPI/Models/EndpointTLSTerminationAtEdge.html +617 -0
- data/docs/NgrokAPI/Models/EndpointWebhookValidation.html +2 -2
- data/docs/NgrokAPI/Models/EndpointWebsocketTCPConverter.html +543 -0
- data/docs/NgrokAPI/Models/EventDestination.html +6 -6
- data/docs/NgrokAPI/Models/EventSource.html +2 -2
- data/docs/NgrokAPI/Models/EventSourceList.html +2 -2
- data/docs/NgrokAPI/Models/EventSourceReplace.html +2 -2
- data/docs/NgrokAPI/Models/EventSubscription.html +2 -2
- data/docs/NgrokAPI/Models/EventTarget.html +2 -2
- data/docs/NgrokAPI/Models/EventTargetCloudwatchLogs.html +2 -2
- data/docs/NgrokAPI/Models/EventTargetFirehose.html +2 -2
- data/docs/NgrokAPI/Models/EventTargetKinesis.html +2 -2
- data/docs/NgrokAPI/Models/FailoverBackend.html +1075 -0
- data/docs/NgrokAPI/Models/HTTPResponseBackend.html +1231 -0
- data/{doc/NgrokAPI/Models/EventStream.html → docs/NgrokAPI/Models/HTTPSEdge.html} +118 -118
- data/docs/NgrokAPI/Models/{EndpointConfiguration.html → HTTPSEdgeRoute.html} +202 -264
- data/docs/NgrokAPI/Models/IPPolicy.html +2 -2
- data/docs/NgrokAPI/Models/IPPolicyRule.html +96 -22
- data/docs/NgrokAPI/Models/IPRestriction.html +2 -2
- data/docs/NgrokAPI/Models/Listable.html +2 -2
- data/docs/NgrokAPI/Models/Ref.html +2 -2
- data/docs/NgrokAPI/Models/ReservedAddr.html +2 -2
- data/docs/NgrokAPI/Models/ReservedDomain.html +2 -2
- data/docs/NgrokAPI/Models/ReservedDomainCertJob.html +2 -2
- data/docs/NgrokAPI/Models/ReservedDomainCertPolicy.html +2 -2
- data/docs/NgrokAPI/Models/ReservedDomainCertStatus.html +2 -2
- data/docs/NgrokAPI/Models/SSHCertificateAuthority.html +2 -2
- data/docs/NgrokAPI/Models/SSHCredential.html +2 -2
- data/docs/NgrokAPI/Models/SSHHostCertificate.html +2 -2
- data/docs/NgrokAPI/Models/SSHUserCertificate.html +2 -2
- data/docs/NgrokAPI/Models/TCPEdge.html +1235 -0
- data/docs/NgrokAPI/Models/TLSCertificate.html +2 -2
- data/docs/NgrokAPI/Models/TLSCertificateSANs.html +2 -2
- data/docs/NgrokAPI/Models/TLSEdge.html +1395 -0
- data/docs/NgrokAPI/Models/Tunnel.html +313 -17
- data/docs/NgrokAPI/Models/TunnelGroupBackend.html +1149 -0
- data/docs/NgrokAPI/Models/TunnelSession.html +2 -2
- data/docs/NgrokAPI/Models/WeightedBackend.html +1075 -0
- data/docs/NgrokAPI/Models.html +4 -4
- data/docs/NgrokAPI/PagedIterator.html +2 -2
- data/docs/NgrokAPI/Services/APIKeysClient.html +2 -2
- data/docs/NgrokAPI/Services/AbuseReportsClient.html +2 -2
- data/docs/NgrokAPI/Services/AgentIngressesClient.html +2 -2
- data/docs/NgrokAPI/Services/CertificateAuthoritiesClient.html +2 -2
- data/docs/NgrokAPI/Services/CredentialsClient.html +2 -2
- data/docs/NgrokAPI/Services/EdgeRouteBackendModuleClient.html +1153 -0
- data/docs/NgrokAPI/Services/{EndpointCircuitBreakerModuleClient.html → EdgeRouteCircuitBreakerModuleClient.html} +206 -96
- data/{doc/NgrokAPI/Services/EndpointCompressionModuleClient.html → docs/NgrokAPI/Services/EdgeRouteCompressionModuleClient.html} +206 -96
- data/docs/NgrokAPI/Services/EdgeRouteIPRestrictionModuleClient.html +1153 -0
- data/docs/NgrokAPI/Services/EdgeRouteOAuthModuleClient.html +1153 -0
- data/docs/NgrokAPI/Services/EdgeRouteOIDCModuleClient.html +1153 -0
- data/docs/NgrokAPI/Services/EdgeRouteRequestHeadersModuleClient.html +1153 -0
- data/{doc/NgrokAPI/Services/EndpointResponseHeadersModuleClient.html → docs/NgrokAPI/Services/EdgeRouteResponseHeadersModuleClient.html} +206 -96
- data/docs/NgrokAPI/Services/EdgeRouteSAMLModuleClient.html +1153 -0
- data/docs/NgrokAPI/Services/{EndpointWebhookValidationModuleClient.html → EdgeRouteWebhookVerificationModuleClient.html} +206 -96
- data/docs/NgrokAPI/Services/EdgeRouteWebsocketTCPConverterModuleClient.html +1153 -0
- data/docs/NgrokAPI/Services/{EventStreamsClient.html → EdgesHTTPSClient.html} +236 -271
- data/{doc/NgrokAPI/Services/EndpointConfigurationsClient.html → docs/NgrokAPI/Services/EdgesHTTPSRoutesClient.html} +456 -620
- data/docs/NgrokAPI/Services/EdgesTCPClient.html +1757 -0
- data/docs/NgrokAPI/Services/EdgesTLSClient.html +1847 -0
- data/docs/NgrokAPI/Services/EndpointsClient.html +907 -0
- data/docs/NgrokAPI/Services/EventDestinationsClient.html +35 -35
- data/docs/NgrokAPI/Services/EventSourcesClient.html +2 -2
- data/docs/NgrokAPI/Services/EventSubscriptionsClient.html +5 -5
- data/docs/NgrokAPI/Services/FailoverBackendsClient.html +1644 -0
- data/docs/NgrokAPI/Services/HTTPResponseBackendsClient.html +1744 -0
- data/{doc/NgrokAPI/Services/EndpointSAMLModuleClient.html → docs/NgrokAPI/Services/HTTPSEdgeMutualTLSModuleClient.html} +59 -59
- data/docs/NgrokAPI/Services/{EndpointRequestHeadersModuleClient.html → HTTPSEdgeTLSTerminationModuleClient.html} +59 -59
- data/docs/NgrokAPI/Services/IPPoliciesClient.html +40 -58
- data/docs/NgrokAPI/Services/IPPolicyRulesClient.html +60 -40
- data/docs/NgrokAPI/Services/IPRestrictionsClient.html +3 -3
- data/docs/NgrokAPI/Services/ReservedAddrsClient.html +41 -331
- data/docs/NgrokAPI/Services/ReservedDomainsClient.html +94 -674
- data/docs/NgrokAPI/Services/SSHCertificateAuthoritiesClient.html +2 -2
- data/docs/NgrokAPI/Services/SSHCredentialsClient.html +2 -2
- data/docs/NgrokAPI/Services/SSHHostCertificatesClient.html +2 -2
- data/docs/NgrokAPI/Services/SSHUserCertificatesClient.html +2 -2
- data/docs/NgrokAPI/Services/{EndpointOAuthModuleClient.html → TCPEdgeBackendModuleClient.html} +59 -59
- data/docs/NgrokAPI/Services/TCPEdgeIPRestrictionModuleClient.html +1043 -0
- data/docs/NgrokAPI/Services/TLSCertificatesClient.html +2 -2
- data/{doc/NgrokAPI/Services/EndpointOAuthModuleClient.html → docs/NgrokAPI/Services/TLSEdgeBackendModuleClient.html} +59 -59
- data/docs/NgrokAPI/Services/TLSEdgeIPRestrictionModuleClient.html +1043 -0
- data/docs/NgrokAPI/Services/{EndpointMutualTLSModuleClient.html → TLSEdgeMutualTLSModuleClient.html} +41 -41
- data/{doc/NgrokAPI/Services/EndpointTLSTerminationModuleClient.html → docs/NgrokAPI/Services/TLSEdgeTLSTerminationModuleClient.html} +41 -41
- data/docs/NgrokAPI/Services/TunnelGroupBackendsClient.html +1644 -0
- data/docs/NgrokAPI/Services/TunnelSessionsClient.html +2 -2
- data/docs/NgrokAPI/Services/TunnelsClient.html +241 -3
- data/docs/NgrokAPI/Services/WeightedBackendsClient.html +1644 -0
- data/docs/NgrokAPI/Services.html +4 -4
- data/docs/NgrokAPI.html +3 -3
- data/docs/_index.html +237 -60
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +2 -2
- data/docs/index.html +2 -2
- data/docs/method_list.html +3393 -1433
- data/docs/top-level-namespace.html +2 -2
- data/lib/ngrokapi/client.rb +47 -24
- data/lib/ngrokapi/models/endpoint.rb +49 -0
- data/lib/ngrokapi/models/{endpoint_logging.rb → endpoint_backend.rb} +3 -3
- data/lib/ngrokapi/models/{endpoint_logging_mutate.rb → endpoint_backend_mutate.rb} +3 -3
- data/lib/ngrokapi/models/endpoint_tls_termination_at_edge.rb +27 -0
- data/lib/ngrokapi/models/endpoint_websocket_tcp_converter.rb +25 -0
- data/lib/ngrokapi/models/event_destination.rb +1 -2
- data/lib/ngrokapi/models/{event_stream.rb → failover_backend.rb} +15 -27
- data/lib/ngrokapi/models/http_response_backend.rb +71 -0
- data/lib/ngrokapi/models/https_edge.rb +80 -0
- data/lib/ngrokapi/models/{endpoint_configuration.rb → https_edge_route.rb} +56 -53
- data/lib/ngrokapi/models/ip_policy_rule.rb +3 -1
- data/lib/ngrokapi/models/tcp_edge.rb +78 -0
- data/lib/ngrokapi/models/tls_edge.rb +88 -0
- data/lib/ngrokapi/models/tunnel.rb +9 -1
- data/lib/ngrokapi/models/tunnel_group_backend.rb +67 -0
- data/lib/ngrokapi/models/weighted_backend.rb +65 -0
- data/lib/ngrokapi/services/edge_route_backend_module_client.rb +120 -0
- data/lib/ngrokapi/services/{endpoint_circuit_breaker_module_client.rb → edge_route_circuit_breaker_module_client.rb} +37 -25
- data/lib/ngrokapi/services/{endpoint_compression_module_client.rb → edge_route_compression_module_client.rb} +37 -25
- data/lib/ngrokapi/services/edge_route_ip_restriction_module_client.rb +120 -0
- data/lib/ngrokapi/services/edge_route_o_auth_module_client.rb +120 -0
- data/lib/ngrokapi/services/edge_route_oidc_module_client.rb +120 -0
- data/lib/ngrokapi/services/edge_route_request_headers_module_client.rb +120 -0
- data/lib/ngrokapi/services/{endpoint_response_headers_module_client.rb → edge_route_response_headers_module_client.rb} +37 -25
- data/lib/ngrokapi/services/edge_route_saml_module_client.rb +120 -0
- data/lib/ngrokapi/services/{endpoint_webhook_validation_module_client.rb → edge_route_webhook_verification_module_client.rb} +37 -25
- data/lib/ngrokapi/services/edge_route_websocket_tcp_converter_module_client.rb +120 -0
- data/lib/ngrokapi/services/edges_https_client.rb +227 -0
- data/lib/ngrokapi/services/edges_https_routes_client.rb +244 -0
- data/lib/ngrokapi/services/edges_tcp_client.rb +227 -0
- data/lib/ngrokapi/services/edges_tls_client.rb +239 -0
- data/lib/ngrokapi/services/endpoints_client.rb +114 -0
- data/lib/ngrokapi/services/event_destinations_client.rb +2 -4
- data/lib/ngrokapi/services/event_subscriptions_client.rb +3 -3
- data/lib/ngrokapi/services/failover_backends_client.rb +214 -0
- data/lib/ngrokapi/services/http_response_backends_client.rb +199 -0
- data/lib/ngrokapi/services/{endpoint_saml_module_client.rb → https_edge_mutual_tls_module_client.rb} +25 -25
- data/lib/ngrokapi/services/{endpoint_request_headers_module_client.rb → https_edge_tls_termination_module_client.rb} +25 -25
- data/lib/ngrokapi/services/ip_policies_client.rb +1 -3
- data/lib/ngrokapi/services/ip_policy_rules_client.rb +3 -1
- data/lib/ngrokapi/services/ip_restrictions_client.rb +1 -1
- data/lib/ngrokapi/services/reserved_addrs_client.rb +0 -37
- data/lib/ngrokapi/services/reserved_domains_client.rb +0 -74
- data/lib/ngrokapi/services/{endpoint_logging_module_client.rb → tcp_edge_backend_module_client.rb} +25 -25
- data/lib/ngrokapi/services/{endpoint_ip_policy_module_client.rb → tcp_edge_ip_restriction_module_client.rb} +15 -15
- data/lib/ngrokapi/services/{endpoint_oidc_module_client.rb → tls_edge_backend_module_client.rb} +25 -25
- data/lib/ngrokapi/services/{endpoint_o_auth_module_client.rb → tls_edge_ip_restriction_module_client.rb} +25 -25
- data/lib/ngrokapi/services/{endpoint_mutual_tls_module_client.rb → tls_edge_mutual_tls_module_client.rb} +15 -15
- data/lib/ngrokapi/services/{endpoint_tls_termination_module_client.rb → tls_edge_tls_termination_module_client.rb} +15 -15
- data/lib/ngrokapi/services/tunnel_group_backends_client.rb +212 -0
- data/lib/ngrokapi/services/tunnels_client.rb +35 -0
- data/lib/ngrokapi/services/weighted_backends_client.rb +214 -0
- data/lib/ngrokapi/version.rb +1 -1
- data/spec/ngrokapi/client_spec.rb +44 -23
- data/spec/ngrokapi/models/endpoint_backend_mutate_spec.rb +21 -0
- data/spec/ngrokapi/models/endpoint_backend_spec.rb +21 -0
- data/spec/ngrokapi/models/endpoint_spec.rb +21 -0
- data/spec/ngrokapi/models/endpoint_tls_termination_at_edge_spec.rb +21 -0
- data/spec/ngrokapi/models/endpoint_websocket_tcp_converter_spec.rb +21 -0
- data/spec/ngrokapi/models/failover_backend_spec.rb +45 -0
- data/spec/ngrokapi/models/http_response_backend_spec.rb +51 -0
- data/spec/ngrokapi/models/https_edge_route_spec.rb +81 -0
- data/spec/ngrokapi/models/https_edge_spec.rb +51 -0
- data/spec/ngrokapi/models/tcp_edge_spec.rb +51 -0
- data/spec/ngrokapi/models/tls_edge_spec.rb +57 -0
- data/spec/ngrokapi/models/tunnel_group_backend_spec.rb +45 -0
- data/spec/ngrokapi/models/weighted_backend_spec.rb +45 -0
- data/spec/ngrokapi/services/edge_route_backend_module_client_spec.rb +139 -0
- data/spec/ngrokapi/services/{endpoint_circuit_breaker_module_client_spec.rb → edge_route_circuit_breaker_module_client_spec.rb} +31 -17
- data/spec/ngrokapi/services/{endpoint_compression_module_client_spec.rb → edge_route_compression_module_client_spec.rb} +31 -17
- data/spec/ngrokapi/services/edge_route_ip_restriction_module_client_spec.rb +139 -0
- data/spec/ngrokapi/services/{endpoint_o_auth_module_client_spec.rb → edge_route_o_auth_module_client_spec.rb} +31 -17
- data/spec/ngrokapi/services/{endpoint_oidc_module_client_spec.rb → edge_route_oidc_module_client_spec.rb} +31 -17
- data/spec/ngrokapi/services/{endpoint_request_headers_module_client_spec.rb → edge_route_request_headers_module_client_spec.rb} +31 -17
- data/spec/ngrokapi/services/{endpoint_response_headers_module_client_spec.rb → edge_route_response_headers_module_client_spec.rb} +31 -17
- data/spec/ngrokapi/services/{endpoint_saml_module_client_spec.rb → edge_route_saml_module_client_spec.rb} +31 -17
- data/spec/ngrokapi/services/{endpoint_webhook_validation_module_client_spec.rb → edge_route_webhook_verification_module_client_spec.rb} +31 -17
- data/spec/ngrokapi/services/edge_route_websocket_tcp_converter_module_client_spec.rb +139 -0
- data/spec/ngrokapi/services/{event_streams_client_spec.rb → edges_https_client_spec.rb} +106 -108
- data/spec/ngrokapi/services/edges_https_routes_client_spec.rb +241 -0
- data/spec/ngrokapi/services/edges_tcp_client_spec.rb +175 -0
- data/spec/ngrokapi/services/edges_tls_client_spec.rb +187 -0
- data/spec/ngrokapi/services/endpoints_client_spec.rb +57 -0
- data/spec/ngrokapi/services/failover_backends_client_spec.rb +163 -0
- data/spec/ngrokapi/services/http_response_backends_client_spec.rb +175 -0
- data/spec/ngrokapi/services/{endpoint_mutual_tls_module_client_spec.rb → https_edge_mutual_tls_module_client_spec.rb} +17 -17
- data/spec/ngrokapi/services/{endpoint_tls_termination_module_client_spec.rb → https_edge_tls_termination_module_client_spec.rb} +17 -17
- data/spec/ngrokapi/services/ip_policies_client_spec.rb +0 -1
- data/spec/ngrokapi/services/ip_policy_rules_client_spec.rb +3 -1
- data/spec/ngrokapi/services/reserved_addrs_client_spec.rb +0 -44
- data/spec/ngrokapi/services/reserved_domains_client_spec.rb +0 -88
- data/spec/ngrokapi/services/{endpoint_logging_module_client_spec.rb → tcp_edge_backend_module_client_spec.rb} +40 -40
- data/spec/ngrokapi/services/{endpoint_ip_policy_module_client_spec.rb → tcp_edge_ip_restriction_module_client_spec.rb} +17 -17
- data/spec/ngrokapi/services/tls_edge_backend_module_client_spec.rb +125 -0
- data/spec/ngrokapi/services/tls_edge_ip_restriction_module_client_spec.rb +125 -0
- data/spec/ngrokapi/services/tls_edge_mutual_tls_module_client_spec.rb +125 -0
- data/spec/ngrokapi/services/tls_edge_tls_termination_module_client_spec.rb +125 -0
- data/spec/ngrokapi/services/tunnel_group_backends_client_spec.rb +163 -0
- data/spec/ngrokapi/services/tunnels_client_spec.rb +36 -0
- data/spec/ngrokapi/services/weighted_backends_client_spec.rb +163 -0
- data/spec/spec_helper.rb +326 -33
- metadata +166 -74
- data/lib/ngrokapi/services/endpoint_configurations_client.rb +0 -289
- data/lib/ngrokapi/services/event_streams_client.rb +0 -224
- data/spec/ngrokapi/models/endpoint_configuration_spec.rb +0 -78
- data/spec/ngrokapi/models/endpoint_logging_mutate_spec.rb +0 -21
- data/spec/ngrokapi/models/endpoint_logging_spec.rb +0 -21
- data/spec/ngrokapi/models/event_stream_spec.rb +0 -51
- data/spec/ngrokapi/services/endpoint_configurations_client_spec.rb +0 -237
@@ -0,0 +1,125 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe NgrokAPI::Services::TLSEdgeTLSTerminationModuleClient do
|
4
|
+
let(:base_url) { 'https://api.ngrok.com' }
|
5
|
+
let(:path) { '/edges/tls/%{id}/tls_termination' }
|
6
|
+
let(:not_found) do
|
7
|
+
NgrokAPI::Errors::NotFoundError.new(response: endpoint_tls_termination_result)
|
8
|
+
end
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
@client = class_double("HttpClient")
|
12
|
+
@tls_edge_tls_termination_module_client = NgrokAPI::Services::TLSEdgeTLSTerminationModuleClient.new(client: @client)
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "#replace" do
|
16
|
+
it "will make a put request and return an instance of NgrokAPI::Models::EndpointTLSTermination" do
|
17
|
+
path = '/edges/tls/%{id}/tls_termination'
|
18
|
+
replacements = {
|
19
|
+
id: endpoint_tls_termination_result["id"],
|
20
|
+
}
|
21
|
+
data = {}
|
22
|
+
data[:module] = "New a_module"
|
23
|
+
expect(@client).to receive(:put).with(path % replacements, data: data).
|
24
|
+
and_return(endpoint_tls_termination_result)
|
25
|
+
result = @tls_edge_tls_termination_module_client.replace(
|
26
|
+
id: endpoint_tls_termination_result["id"],
|
27
|
+
a_module: "New a_module"
|
28
|
+
)
|
29
|
+
expect(result.class).to eq(NgrokAPI::Models::EndpointTLSTermination)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "#replace!" do
|
34
|
+
it "will make a put request and return an instance of NgrokAPI::Models::EndpointTLSTermination" do
|
35
|
+
path = '/edges/tls/%{id}/tls_termination'
|
36
|
+
replacements = {
|
37
|
+
id: endpoint_tls_termination_result["id"],
|
38
|
+
}
|
39
|
+
data = {}
|
40
|
+
data[:module] = "New a_module"
|
41
|
+
expect(@client).to receive(:put).with(path % replacements, data: data).
|
42
|
+
and_return(endpoint_tls_termination_result)
|
43
|
+
result = @tls_edge_tls_termination_module_client.replace(
|
44
|
+
id: endpoint_tls_termination_result["id"],
|
45
|
+
a_module: "New a_module"
|
46
|
+
)
|
47
|
+
expect(result.class).to eq(NgrokAPI::Models::EndpointTLSTermination)
|
48
|
+
# expect(result.id).to eq(endpoint_tls_termination_result["id"])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe "#get" do
|
53
|
+
it "will make a get request and return an instance of NgrokAPI::Models::EndpointTLSTermination" do
|
54
|
+
path = '/edges/tls/%{id}/tls_termination'
|
55
|
+
replacements = {
|
56
|
+
id: endpoint_tls_termination_result["id"],
|
57
|
+
}
|
58
|
+
data = {}
|
59
|
+
expect(@client).to receive(:get).with(path % replacements, data: data).
|
60
|
+
and_return(endpoint_tls_termination_result)
|
61
|
+
result = @tls_edge_tls_termination_module_client.get(
|
62
|
+
id: endpoint_tls_termination_result["id"]
|
63
|
+
)
|
64
|
+
expect(result.class).to eq(NgrokAPI::Models::EndpointTLSTermination)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe "#get!" do
|
69
|
+
it "will make a get request and return an instance of NgrokAPI::Models::EndpointTLSTermination" do
|
70
|
+
path = '/edges/tls/%{id}/tls_termination'
|
71
|
+
replacements = {
|
72
|
+
id: endpoint_tls_termination_result["id"],
|
73
|
+
}
|
74
|
+
data = {}
|
75
|
+
expect(@client).to receive(:get).with(path % replacements, data: data).
|
76
|
+
and_return(endpoint_tls_termination_result)
|
77
|
+
result = @tls_edge_tls_termination_module_client.get(
|
78
|
+
id: endpoint_tls_termination_result["id"]
|
79
|
+
)
|
80
|
+
expect(result.class).to eq(NgrokAPI::Models::EndpointTLSTermination)
|
81
|
+
# expect(result.id).to eq(endpoint_tls_termination_result["id"])
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
describe "#delete" do
|
86
|
+
it "will make a delete request" do
|
87
|
+
path = '/edges/tls/%{id}/tls_termination'
|
88
|
+
replacements = {
|
89
|
+
id: api_key_result["id"],
|
90
|
+
}
|
91
|
+
expect(@client).to receive(:delete).with(path % replacements).and_return(nil)
|
92
|
+
@tls_edge_tls_termination_module_client.delete(
|
93
|
+
id: api_key_result["id"]
|
94
|
+
)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
describe "#delete!" do
|
99
|
+
it "will make a delete request" do
|
100
|
+
path = '/edges/tls/%{id}/tls_termination'
|
101
|
+
replacements = {
|
102
|
+
id: api_key_result["id"],
|
103
|
+
}
|
104
|
+
expect(@client).to receive(:delete).with(path % replacements, danger: true).and_return(nil)
|
105
|
+
@tls_edge_tls_termination_module_client.delete!(
|
106
|
+
id: api_key_result["id"]
|
107
|
+
)
|
108
|
+
end
|
109
|
+
|
110
|
+
it "will make a delete request and return NotFoundError if 404" do
|
111
|
+
path = '/edges/tls/%{id}/tls_termination'
|
112
|
+
replacements = {
|
113
|
+
id: api_key_result["id"],
|
114
|
+
}
|
115
|
+
expect do
|
116
|
+
expect(@client).to receive(:delete).with(path % replacements, danger: true).
|
117
|
+
and_raise(NgrokAPI::Errors::NotFoundError)
|
118
|
+
result = @tls_edge_tls_termination_module_client.delete!(
|
119
|
+
id: api_key_result["id"]
|
120
|
+
)
|
121
|
+
expect(result).to be nil
|
122
|
+
end.to raise_error(NgrokAPI::Errors::NotFoundError)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,163 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe NgrokAPI::Services::TunnelGroupBackendsClient do
|
4
|
+
let(:base_url) { 'https://api.ngrok.com' }
|
5
|
+
let(:path) { '/backends/tunnel_group' }
|
6
|
+
let(:not_found) do
|
7
|
+
NgrokAPI::Errors::NotFoundError.new(response: tunnel_group_backend_result)
|
8
|
+
end
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
@client = class_double("HttpClient")
|
12
|
+
@tunnel_group_backends_client = NgrokAPI::Services::TunnelGroupBackendsClient.new(client: @client)
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "#create" do
|
16
|
+
it "will make a post request and return an instance of NgrokAPI::Models::TunnelGroupBackend" do
|
17
|
+
path = '/backends/tunnel_group'
|
18
|
+
replacements = {
|
19
|
+
}
|
20
|
+
data = {}
|
21
|
+
data[:description] = "New description"
|
22
|
+
data[:metadata] = "New metadata"
|
23
|
+
data[:labels] = "New labels"
|
24
|
+
expect(@client).to receive(:post).with(path % replacements, data: data).
|
25
|
+
and_return(tunnel_group_backend_result)
|
26
|
+
result = @tunnel_group_backends_client.create(
|
27
|
+
description: "New description",
|
28
|
+
metadata: "New metadata",
|
29
|
+
labels: "New labels"
|
30
|
+
)
|
31
|
+
expect(result.class).to eq(NgrokAPI::Models::TunnelGroupBackend)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "#delete" do
|
36
|
+
it "will make a delete request" do
|
37
|
+
path = '/backends/tunnel_group/%{id}'
|
38
|
+
replacements = {
|
39
|
+
id: api_key_result["id"],
|
40
|
+
}
|
41
|
+
expect(@client).to receive(:delete).with(path % replacements).and_return(nil)
|
42
|
+
@tunnel_group_backends_client.delete(
|
43
|
+
id: api_key_result["id"]
|
44
|
+
)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "#delete!" do
|
49
|
+
it "will make a delete request" do
|
50
|
+
path = '/backends/tunnel_group/%{id}'
|
51
|
+
replacements = {
|
52
|
+
id: api_key_result["id"],
|
53
|
+
}
|
54
|
+
expect(@client).to receive(:delete).with(path % replacements, danger: true).and_return(nil)
|
55
|
+
@tunnel_group_backends_client.delete!(
|
56
|
+
id: api_key_result["id"]
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "will make a delete request and return NotFoundError if 404" do
|
61
|
+
path = '/backends/tunnel_group/%{id}'
|
62
|
+
replacements = {
|
63
|
+
id: api_key_result["id"],
|
64
|
+
}
|
65
|
+
expect do
|
66
|
+
expect(@client).to receive(:delete).with(path % replacements, danger: true).
|
67
|
+
and_raise(NgrokAPI::Errors::NotFoundError)
|
68
|
+
result = @tunnel_group_backends_client.delete!(
|
69
|
+
id: api_key_result["id"]
|
70
|
+
)
|
71
|
+
expect(result).to be nil
|
72
|
+
end.to raise_error(NgrokAPI::Errors::NotFoundError)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe "#get" do
|
77
|
+
it "will make a get request and return an instance of NgrokAPI::Models::TunnelGroupBackend" do
|
78
|
+
path = '/backends/tunnel_group/%{id}'
|
79
|
+
replacements = {
|
80
|
+
id: tunnel_group_backend_result["id"],
|
81
|
+
}
|
82
|
+
data = {}
|
83
|
+
expect(@client).to receive(:get).with(path % replacements, data: data).
|
84
|
+
and_return(tunnel_group_backend_result)
|
85
|
+
result = @tunnel_group_backends_client.get(
|
86
|
+
id: tunnel_group_backend_result["id"]
|
87
|
+
)
|
88
|
+
expect(result.class).to eq(NgrokAPI::Models::TunnelGroupBackend)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "#get!" do
|
93
|
+
it "will make a get request and return an instance of NgrokAPI::Models::TunnelGroupBackend" do
|
94
|
+
path = '/backends/tunnel_group/%{id}'
|
95
|
+
replacements = {
|
96
|
+
id: tunnel_group_backend_result["id"],
|
97
|
+
}
|
98
|
+
data = {}
|
99
|
+
expect(@client).to receive(:get).with(path % replacements, data: data).
|
100
|
+
and_return(tunnel_group_backend_result)
|
101
|
+
result = @tunnel_group_backends_client.get(
|
102
|
+
id: tunnel_group_backend_result["id"]
|
103
|
+
)
|
104
|
+
expect(result.class).to eq(NgrokAPI::Models::TunnelGroupBackend)
|
105
|
+
# expect(result.id).to eq(tunnel_group_backend_result["id"])
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
describe "#list" do
|
110
|
+
it "will make a call to list (a GET request) and return a NgrokAPI::Models::Listable" do
|
111
|
+
expect(@client).to receive(:list).
|
112
|
+
and_return(tunnel_group_backend_results)
|
113
|
+
url = base_url + path + "?before_id=" + api_key_result["id"] + "&limit=1"
|
114
|
+
result = @tunnel_group_backends_client.list(url: url)
|
115
|
+
expect(result.class).to eq(NgrokAPI::Models::Listable)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe "#update" do
|
120
|
+
it "will make a patch request and return an instance of NgrokAPI::Models::TunnelGroupBackend" do
|
121
|
+
path = '/backends/tunnel_group/%{id}'
|
122
|
+
replacements = {
|
123
|
+
id: tunnel_group_backend_result["id"],
|
124
|
+
}
|
125
|
+
data = {}
|
126
|
+
data[:description] = "New description"
|
127
|
+
data[:metadata] = "New metadata"
|
128
|
+
data[:labels] = "New labels"
|
129
|
+
expect(@client).to receive(:patch).with(path % replacements, data: data).
|
130
|
+
and_return(tunnel_group_backend_result)
|
131
|
+
result = @tunnel_group_backends_client.update(
|
132
|
+
id: tunnel_group_backend_result["id"],
|
133
|
+
description: "New description",
|
134
|
+
metadata: "New metadata",
|
135
|
+
labels: "New labels"
|
136
|
+
)
|
137
|
+
expect(result.class).to eq(NgrokAPI::Models::TunnelGroupBackend)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe "#update!" do
|
142
|
+
it "will make a patch request and return an instance of NgrokAPI::Models::TunnelGroupBackend" do
|
143
|
+
path = '/backends/tunnel_group/%{id}'
|
144
|
+
replacements = {
|
145
|
+
id: tunnel_group_backend_result["id"],
|
146
|
+
}
|
147
|
+
data = {}
|
148
|
+
data[:description] = "New description"
|
149
|
+
data[:metadata] = "New metadata"
|
150
|
+
data[:labels] = "New labels"
|
151
|
+
expect(@client).to receive(:patch).with(path % replacements, data: data).
|
152
|
+
and_return(tunnel_group_backend_result)
|
153
|
+
result = @tunnel_group_backends_client.update(
|
154
|
+
id: tunnel_group_backend_result["id"],
|
155
|
+
description: "New description",
|
156
|
+
metadata: "New metadata",
|
157
|
+
labels: "New labels"
|
158
|
+
)
|
159
|
+
expect(result.class).to eq(NgrokAPI::Models::TunnelGroupBackend)
|
160
|
+
# expect(result.id).to eq(tunnel_group_backend_result["id"])
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
@@ -3,6 +3,9 @@ require 'spec_helper'
|
|
3
3
|
RSpec.describe NgrokAPI::Services::TunnelsClient do
|
4
4
|
let(:base_url) { 'https://api.ngrok.com' }
|
5
5
|
let(:path) { '/tunnels' }
|
6
|
+
let(:not_found) do
|
7
|
+
NgrokAPI::Errors::NotFoundError.new(response: tunnel_result)
|
8
|
+
end
|
6
9
|
|
7
10
|
before(:each) do
|
8
11
|
@client = class_double("HttpClient")
|
@@ -18,4 +21,37 @@ RSpec.describe NgrokAPI::Services::TunnelsClient do
|
|
18
21
|
expect(result.class).to eq(NgrokAPI::Models::Listable)
|
19
22
|
end
|
20
23
|
end
|
24
|
+
|
25
|
+
describe "#get" do
|
26
|
+
it "will make a get request and return an instance of NgrokAPI::Models::Tunnel" do
|
27
|
+
path = '/tunnels/%{id}'
|
28
|
+
replacements = {
|
29
|
+
id: tunnel_result["id"],
|
30
|
+
}
|
31
|
+
data = {}
|
32
|
+
expect(@client).to receive(:get).with(path % replacements, data: data).
|
33
|
+
and_return(tunnel_result)
|
34
|
+
result = @tunnels_client.get(
|
35
|
+
id: tunnel_result["id"]
|
36
|
+
)
|
37
|
+
expect(result.class).to eq(NgrokAPI::Models::Tunnel)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "#get!" do
|
42
|
+
it "will make a get request and return an instance of NgrokAPI::Models::Tunnel" do
|
43
|
+
path = '/tunnels/%{id}'
|
44
|
+
replacements = {
|
45
|
+
id: tunnel_result["id"],
|
46
|
+
}
|
47
|
+
data = {}
|
48
|
+
expect(@client).to receive(:get).with(path % replacements, data: data).
|
49
|
+
and_return(tunnel_result)
|
50
|
+
result = @tunnels_client.get(
|
51
|
+
id: tunnel_result["id"]
|
52
|
+
)
|
53
|
+
expect(result.class).to eq(NgrokAPI::Models::Tunnel)
|
54
|
+
# expect(result.id).to eq(tunnel_result["id"])
|
55
|
+
end
|
56
|
+
end
|
21
57
|
end
|
@@ -0,0 +1,163 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe NgrokAPI::Services::WeightedBackendsClient do
|
4
|
+
let(:base_url) { 'https://api.ngrok.com' }
|
5
|
+
let(:path) { '/backends/weighted' }
|
6
|
+
let(:not_found) do
|
7
|
+
NgrokAPI::Errors::NotFoundError.new(response: weighted_backend_result)
|
8
|
+
end
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
@client = class_double("HttpClient")
|
12
|
+
@weighted_backends_client = NgrokAPI::Services::WeightedBackendsClient.new(client: @client)
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "#create" do
|
16
|
+
it "will make a post request and return an instance of NgrokAPI::Models::WeightedBackend" do
|
17
|
+
path = '/backends/weighted'
|
18
|
+
replacements = {
|
19
|
+
}
|
20
|
+
data = {}
|
21
|
+
data[:description] = "New description"
|
22
|
+
data[:metadata] = "New metadata"
|
23
|
+
data[:backends] = "New backends"
|
24
|
+
expect(@client).to receive(:post).with(path % replacements, data: data).
|
25
|
+
and_return(weighted_backend_result)
|
26
|
+
result = @weighted_backends_client.create(
|
27
|
+
description: "New description",
|
28
|
+
metadata: "New metadata",
|
29
|
+
backends: "New backends"
|
30
|
+
)
|
31
|
+
expect(result.class).to eq(NgrokAPI::Models::WeightedBackend)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "#delete" do
|
36
|
+
it "will make a delete request" do
|
37
|
+
path = '/backends/weighted/%{id}'
|
38
|
+
replacements = {
|
39
|
+
id: api_key_result["id"],
|
40
|
+
}
|
41
|
+
expect(@client).to receive(:delete).with(path % replacements).and_return(nil)
|
42
|
+
@weighted_backends_client.delete(
|
43
|
+
id: api_key_result["id"]
|
44
|
+
)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "#delete!" do
|
49
|
+
it "will make a delete request" do
|
50
|
+
path = '/backends/weighted/%{id}'
|
51
|
+
replacements = {
|
52
|
+
id: api_key_result["id"],
|
53
|
+
}
|
54
|
+
expect(@client).to receive(:delete).with(path % replacements, danger: true).and_return(nil)
|
55
|
+
@weighted_backends_client.delete!(
|
56
|
+
id: api_key_result["id"]
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "will make a delete request and return NotFoundError if 404" do
|
61
|
+
path = '/backends/weighted/%{id}'
|
62
|
+
replacements = {
|
63
|
+
id: api_key_result["id"],
|
64
|
+
}
|
65
|
+
expect do
|
66
|
+
expect(@client).to receive(:delete).with(path % replacements, danger: true).
|
67
|
+
and_raise(NgrokAPI::Errors::NotFoundError)
|
68
|
+
result = @weighted_backends_client.delete!(
|
69
|
+
id: api_key_result["id"]
|
70
|
+
)
|
71
|
+
expect(result).to be nil
|
72
|
+
end.to raise_error(NgrokAPI::Errors::NotFoundError)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe "#get" do
|
77
|
+
it "will make a get request and return an instance of NgrokAPI::Models::WeightedBackend" do
|
78
|
+
path = '/backends/weighted/%{id}'
|
79
|
+
replacements = {
|
80
|
+
id: weighted_backend_result["id"],
|
81
|
+
}
|
82
|
+
data = {}
|
83
|
+
expect(@client).to receive(:get).with(path % replacements, data: data).
|
84
|
+
and_return(weighted_backend_result)
|
85
|
+
result = @weighted_backends_client.get(
|
86
|
+
id: weighted_backend_result["id"]
|
87
|
+
)
|
88
|
+
expect(result.class).to eq(NgrokAPI::Models::WeightedBackend)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "#get!" do
|
93
|
+
it "will make a get request and return an instance of NgrokAPI::Models::WeightedBackend" do
|
94
|
+
path = '/backends/weighted/%{id}'
|
95
|
+
replacements = {
|
96
|
+
id: weighted_backend_result["id"],
|
97
|
+
}
|
98
|
+
data = {}
|
99
|
+
expect(@client).to receive(:get).with(path % replacements, data: data).
|
100
|
+
and_return(weighted_backend_result)
|
101
|
+
result = @weighted_backends_client.get(
|
102
|
+
id: weighted_backend_result["id"]
|
103
|
+
)
|
104
|
+
expect(result.class).to eq(NgrokAPI::Models::WeightedBackend)
|
105
|
+
# expect(result.id).to eq(weighted_backend_result["id"])
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
describe "#list" do
|
110
|
+
it "will make a call to list (a GET request) and return a NgrokAPI::Models::Listable" do
|
111
|
+
expect(@client).to receive(:list).
|
112
|
+
and_return(weighted_backend_results)
|
113
|
+
url = base_url + path + "?before_id=" + api_key_result["id"] + "&limit=1"
|
114
|
+
result = @weighted_backends_client.list(url: url)
|
115
|
+
expect(result.class).to eq(NgrokAPI::Models::Listable)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe "#update" do
|
120
|
+
it "will make a patch request and return an instance of NgrokAPI::Models::WeightedBackend" do
|
121
|
+
path = '/backends/weighted/%{id}'
|
122
|
+
replacements = {
|
123
|
+
id: weighted_backend_result["id"],
|
124
|
+
}
|
125
|
+
data = {}
|
126
|
+
data[:description] = "New description"
|
127
|
+
data[:metadata] = "New metadata"
|
128
|
+
data[:backends] = "New backends"
|
129
|
+
expect(@client).to receive(:patch).with(path % replacements, data: data).
|
130
|
+
and_return(weighted_backend_result)
|
131
|
+
result = @weighted_backends_client.update(
|
132
|
+
id: weighted_backend_result["id"],
|
133
|
+
description: "New description",
|
134
|
+
metadata: "New metadata",
|
135
|
+
backends: "New backends"
|
136
|
+
)
|
137
|
+
expect(result.class).to eq(NgrokAPI::Models::WeightedBackend)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe "#update!" do
|
142
|
+
it "will make a patch request and return an instance of NgrokAPI::Models::WeightedBackend" do
|
143
|
+
path = '/backends/weighted/%{id}'
|
144
|
+
replacements = {
|
145
|
+
id: weighted_backend_result["id"],
|
146
|
+
}
|
147
|
+
data = {}
|
148
|
+
data[:description] = "New description"
|
149
|
+
data[:metadata] = "New metadata"
|
150
|
+
data[:backends] = "New backends"
|
151
|
+
expect(@client).to receive(:patch).with(path % replacements, data: data).
|
152
|
+
and_return(weighted_backend_result)
|
153
|
+
result = @weighted_backends_client.update(
|
154
|
+
id: weighted_backend_result["id"],
|
155
|
+
description: "New description",
|
156
|
+
metadata: "New metadata",
|
157
|
+
backends: "New backends"
|
158
|
+
)
|
159
|
+
expect(result.class).to eq(NgrokAPI::Models::WeightedBackend)
|
160
|
+
# expect(result.id).to eq(weighted_backend_result["id"])
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|