Update generated files

This commit is contained in:
ngrok release bot
2026-05-08 14:41:45 +00:00
parent aed5dfcebe
commit 9ea73a750f
69 changed files with 1838 additions and 1417 deletions
+9
View File
@@ -1,4 +1,13 @@
<!-- Code generated for API Clients. DO NOT EDIT. -->
## v9.0.0
### Breaking Changes
* The module path is now `github.com/ngrok/ngrok-api-go/v9`. Update your imports accordingly.
* JSON serialization now uses the `omitzero` struct tag option instead of `omitempty`. This restores the ability to distinguish "field not set" from "field explicitly empty" for slice and map fields:
* A `nil` slice or map is still omitted from the request body.
* An empty slice (`[]T{}`) or empty map (`map[K]V{}`) is now serialized as `[]` or `{}`. Previously these were silently omitted, which made it impossible to clear a list or map via the API.
* Required code review of any callers that pass empty (non-nil) slices/maps where they previously relied on the field being omitted.
* As a side effect of `omitzero`, zero-value `time.Time` fields are now omitted instead of being serialized as `"0001-01-01T00:00:00Z"`.
## v8.0.0
### Breaking Changes
* List methods for resources that support CEL filtering now accept `*FilteredPaging` instead of `*Paging`. `FilteredPaging` adds a `Filter` field for passing CEL filter expressions.
+9 -9
View File
@@ -2,7 +2,7 @@
# ngrok API client library for Golang
[![CI](https://github.com/ngrok/ngrok-api-go/actions/workflows/ci.yml/badge.svg)](https://github.com/ngrok/ngrok-api-go/actions/workflows/ci.yml)
[![Go Reference](https://pkg.go.dev/badge/github.com/ngrok/ngrok-api-go.svg)](https://pkg.go.dev/github.com/ngrok/ngrok-api-go/v8)
[![Go Reference](https://pkg.go.dev/badge/github.com/ngrok/ngrok-api-go.svg)](https://pkg.go.dev/github.com/ngrok/ngrok-api-go/v9)
This library wraps the [ngrok HTTP API](https://ngrok.com/docs/api) to make it
easier to consume in Go.
@@ -13,7 +13,7 @@ For creating ngrok tunnels directly from your Go application, check out the [ngr
Installation is as simple as using `go get`.
go get github.com/ngrok/ngrok-api-go/v8
go get github.com/ngrok/ngrok-api-go/v9
## Support
@@ -21,11 +21,11 @@ The best place to get support using this library is through the [ngrok Slack Com
## Documentation
A quickstart guide and a full API reference are included in the [ngrok go API documentation on pkg.go.dev](https://pkg.go.dev/github.com/ngrok/ngrok-api-go/v8)
A quickstart guide and a full API reference are included in the [ngrok go API documentation on pkg.go.dev](https://pkg.go.dev/github.com/ngrok/ngrok-api-go/v9)
## Quickstart
Please consult the [documentation](https://pkg.go.dev/github.com/ngrok/ngrok-api-go/v8) for additional examples.
Please consult the [documentation](https://pkg.go.dev/github.com/ngrok/ngrok-api-go/v9) for additional examples.
### Create an IP Policy that allows traffic from some subnets
@@ -37,9 +37,9 @@ import (
"fmt"
"os"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/ip_policies"
"github.com/ngrok/ngrok-api-go/v8/ip_policy_rules"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/ip_policies"
"github.com/ngrok/ngrok-api-go/v9/ip_policy_rules"
)
func main() {
@@ -85,8 +85,8 @@ import (
"fmt"
"os"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/tunnels"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/tunnels"
)
func main() {
+4 -4
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Abuse Reports allow you to submit take-down requests for URLs hosted by
@@ -28,7 +28,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// response team. This API is only available to authorized accounts. Contact
// abuse@ngrok.com to request access
//
// https://ngrok.com/docs/api#api-abuse-reports-create
// https://ngrok.com/docs/api-reference/abusereports/create
func (c *Client) Create(ctx context.Context, arg *ngrok.AbuseReportCreate) (*ngrok.AbuseReport, error) {
var res ngrok.AbuseReport
var path bytes.Buffer
@@ -50,7 +50,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.AbuseReportCreate) (*ngr
// Get the detailed status of abuse report by ID.
//
// https://ngrok.com/docs/api#api-abuse-reports-get
// https://ngrok.com/docs/api-reference/abusereports/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.AbuseReport, error) {
arg := &ngrok.Item{ID: id}
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -24,7 +24,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// 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.
//
// https://ngrok.com/docs/api#api-agent-ingresses-create
// https://ngrok.com/docs/api-reference/agentingresses/create
func (c *Client) Create(ctx context.Context, arg *ngrok.AgentIngressCreate) (*ngrok.AgentIngress, error) {
var res ngrok.AgentIngress
var path bytes.Buffer
@@ -46,7 +46,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.AgentIngressCreate) (*ng
// Delete an Agent Ingress by ID
//
// https://ngrok.com/docs/api#api-agent-ingresses-delete
// https://ngrok.com/docs/api-reference/agentingresses/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -69,7 +69,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get the details of an Agent Ingress by ID.
//
// https://ngrok.com/docs/api#api-agent-ingresses-get
// https://ngrok.com/docs/api-reference/agentingresses/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.AgentIngress, error) {
arg := &ngrok.Item{ID: id}
@@ -93,7 +93,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.AgentIngress, error
// List all Agent Ingresses owned by this account
//
// https://ngrok.com/docs/api#api-agent-ingresses-list
// https://ngrok.com/docs/api-reference/agentingresses/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.AgentIngress] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -197,7 +197,7 @@ func (it *iterList) Err() error {
// Update attributes of an Agent Ingress by ID.
//
// https://ngrok.com/docs/api#api-agent-ingresses-update
// https://ngrok.com/docs/api-reference/agentingresses/update
func (c *Client) Update(ctx context.Context, arg *ngrok.AgentIngressUpdate) (*ngrok.AgentIngress, error) {
if arg == nil {
arg = new(ngrok.AgentIngressUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// AIGatewayAPIKeys is an api service for managing API keys used to authenticate
@@ -26,7 +26,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new AI Gateway API Key
//
// https://ngrok.com/docs/api#api-ai-gateway-api-keys-create
// https://ngrok.com/docs/api-reference/aigatewayapikeys/create
func (c *Client) Create(ctx context.Context, arg *ngrok.AIGatewayAPIKeyCreate) (*ngrok.AIGatewayAPIKey, error) {
var res ngrok.AIGatewayAPIKey
var path bytes.Buffer
@@ -48,7 +48,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.AIGatewayAPIKeyCreate) (
// Update an existing AI Gateway API Key by ID
//
// https://ngrok.com/docs/api#api-ai-gateway-api-keys-update
// https://ngrok.com/docs/api-reference/aigatewayapikeys/update
func (c *Client) Update(ctx context.Context, arg *ngrok.AIGatewayAPIKeyUpdate) (*ngrok.AIGatewayAPIKey, error) {
if arg == nil {
arg = new(ngrok.AIGatewayAPIKeyUpdate)
@@ -74,7 +74,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.AIGatewayAPIKeyUpdate) (
// Delete an AI Gateway API Key
//
// https://ngrok.com/docs/api#api-ai-gateway-api-keys-delete
// https://ngrok.com/docs/api-reference/aigatewayapikeys/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -97,7 +97,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get an AI Gateway API Key by ID
//
// https://ngrok.com/docs/api#api-ai-gateway-api-keys-get
// https://ngrok.com/docs/api-reference/aigatewayapikeys/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.AIGatewayAPIKey, error) {
arg := &ngrok.Item{ID: id}
@@ -121,7 +121,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.AIGatewayAPIKey, er
// List all AI Gateway API Keys owned by account
//
// https://ngrok.com/docs/api#api-ai-gateway-api-keys-list
// https://ngrok.com/docs/api-reference/aigatewayapikeys/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.AIGatewayAPIKey] {
if paging == nil {
paging = new(ngrok.Paging)
+221
View File
@@ -0,0 +1,221 @@
// Code generated for API Clients. DO NOT EDIT.
package ai_gateway_provider_keys
import (
"bytes"
"context"
"fmt"
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// AIGatewayProviderKeys is an api service for managing provider keys attached to
// an AI Gateway API Key.
type Client struct {
apiClient *api.Client
}
func NewClient(cfg *ngrok.ClientConfig) *Client {
return &Client{apiClient: api.NewClient(cfg)}
}
// Create a new AI Gateway Provider Key
//
// https://ngrok.com/docs/api-reference/aigatewayproviderkeys/create
func (c *Client) Create(ctx context.Context, arg *ngrok.AIGatewayProviderKeyCreate) (*ngrok.AIGatewayProviderKey, error) {
var res ngrok.AIGatewayProviderKey
var path bytes.Buffer
if err := template.Must(template.New("create_path").Parse("/ai_gateway_provider_keys")).Execute(&path, arg); err != nil {
return nil, fmt.Errorf("error building path for create: %w", err)
}
var (
apiURL = &url.URL{Path: path.String()}
bodyArg interface{}
)
apiURL.Path = path.String()
bodyArg = arg
if err := c.apiClient.Do(ctx, "POST", apiURL, bodyArg, &res); err != nil {
return nil, err
}
return &res, nil
}
// Update an existing AI Gateway Provider Key by ID
//
// https://ngrok.com/docs/api-reference/aigatewayproviderkeys/update
func (c *Client) Update(ctx context.Context, arg *ngrok.AIGatewayProviderKeyUpdate) (*ngrok.AIGatewayProviderKey, error) {
if arg == nil {
arg = new(ngrok.AIGatewayProviderKeyUpdate)
}
var res ngrok.AIGatewayProviderKey
var path bytes.Buffer
if err := template.Must(template.New("update_path").Parse("/ai_gateway_provider_keys/{{ .ID }}")).Execute(&path, arg); err != nil {
return nil, fmt.Errorf("error building path for update: %w", err)
}
arg.ID = ""
var (
apiURL = &url.URL{Path: path.String()}
bodyArg interface{}
)
apiURL.Path = path.String()
bodyArg = arg
if err := c.apiClient.Do(ctx, "PATCH", apiURL, bodyArg, &res); err != nil {
return nil, err
}
return &res, nil
}
// Delete an AI Gateway Provider Key
//
// https://ngrok.com/docs/api-reference/aigatewayproviderkeys/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
var path bytes.Buffer
if err := template.Must(template.New("delete_path").Parse("/ai_gateway_provider_keys/{{ .ID }}")).Execute(&path, arg); err != nil {
return fmt.Errorf("error building path for delete: %w", err)
}
arg.ID = ""
var (
apiURL = &url.URL{Path: path.String()}
bodyArg interface{}
)
apiURL.Path = path.String()
if err := c.apiClient.Do(ctx, "DELETE", apiURL, bodyArg, nil); err != nil {
return err
}
return nil
}
// Get an AI Gateway Provider Key by ID
//
// https://ngrok.com/docs/api-reference/aigatewayproviderkeys/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.AIGatewayProviderKey, error) {
arg := &ngrok.Item{ID: id}
var res ngrok.AIGatewayProviderKey
var path bytes.Buffer
if err := template.Must(template.New("get_path").Parse("/ai_gateway_provider_keys/{{ .ID }}")).Execute(&path, arg); err != nil {
return nil, fmt.Errorf("error building path for get: %w", err)
}
arg.ID = ""
var (
apiURL = &url.URL{Path: path.String()}
bodyArg interface{}
)
apiURL.Path = path.String()
if err := c.apiClient.Do(ctx, "GET", apiURL, bodyArg, &res); err != nil {
return nil, err
}
return &res, nil
}
// List AI Gateway Provider Keys
//
// https://ngrok.com/docs/api-reference/aigatewayproviderkeys/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.AIGatewayProviderKey] {
if paging == nil {
paging = new(ngrok.Paging)
}
var path bytes.Buffer
if err := template.Must(template.New("list_path").Parse("/ai_gateway_provider_keys")).Execute(&path, paging); err != nil {
return &iterList{err: fmt.Errorf("error building path for list: %w", err)}
}
var apiURL = &url.URL{Path: path.String()}
queryVals := make(url.Values)
if paging.BeforeID != nil {
queryVals.Set("before_id", *paging.BeforeID)
}
if paging.Limit != nil {
queryVals.Set("limit", *paging.Limit)
}
apiURL.RawQuery = queryVals.Encode()
return &iterList{
client: c,
n: -1,
nextPage: apiURL,
}
}
// iter allows the caller to iterate through a list of values while
// automatically fetching new pages worth of values from the API.
type iterList struct {
client *Client
n int
items []ngrok.AIGatewayProviderKey
err error
nextPage *url.URL
}
// Next returns true if there is another value available in the iterator. If it
// returs true it also advances the iterator to that next available item.
func (it *iterList) Next(ctx context.Context) bool {
// no more if there is an error
if it.err != nil {
return false
}
// advance the iterator
it.n += 1
// is there an available item?
if it.n < len(it.items) {
return true
}
// no more items, do we have a next page?
if it.nextPage == nil {
return false
}
// fetch the next page
var resp ngrok.AIGatewayProviderKeyList
err := it.client.apiClient.Do(ctx, "GET", it.nextPage, nil, &resp)
if err != nil {
it.err = err
return false
}
// parse the next page URI as soon as we get it and store it
// so we can use it on the next fetch
if resp.NextPageURI != nil {
it.nextPage, it.err = url.Parse(*resp.NextPageURI)
if it.err != nil {
return false
}
} else {
it.nextPage = nil
}
// page with zero items means there are no more
if len(resp.AiGatewayProviderKeys) == 0 {
return false
}
it.n = -1
it.items = resp.AiGatewayProviderKeys
return it.Next(ctx)
}
// Item() returns the AIGatewayProviderKey currently
// pointed to by the iterator.
func (it *iterList) Item() *ngrok.AIGatewayProviderKey {
return &it.items[it.n]
}
// If Next() returned false because an error was encountered while fetching the
// next value Err() will return that error. A caller should always check Err()
// after Next() returns false.
func (it *iterList) Err() error {
return it.err
}
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// API Keys are used to authenticate to the ngrok
@@ -30,7 +30,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new API key. The generated API key can be used to authenticate to the
// ngrok API.
//
// https://ngrok.com/docs/api#api-api-keys-create
// https://ngrok.com/docs/api-reference/apikeys/create
func (c *Client) Create(ctx context.Context, arg *ngrok.APIKeyCreate) (*ngrok.APIKey, error) {
if arg == nil {
arg = new(ngrok.APIKeyCreate)
@@ -55,7 +55,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.APIKeyCreate) (*ngrok.AP
// Delete an API key by ID
//
// https://ngrok.com/docs/api#api-api-keys-delete
// https://ngrok.com/docs/api-reference/apikeys/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -78,7 +78,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get the details of an API key by ID.
//
// https://ngrok.com/docs/api#api-api-keys-get
// https://ngrok.com/docs/api-reference/apikeys/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.APIKey, error) {
arg := &ngrok.Item{ID: id}
@@ -102,7 +102,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.APIKey, error) {
// List all API keys owned by this account
//
// https://ngrok.com/docs/api#api-api-keys-list
// https://ngrok.com/docs/api-reference/apikeys/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.APIKey] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -206,7 +206,7 @@ func (it *iterList) Err() error {
// Update attributes of an API key by ID.
//
// https://ngrok.com/docs/api#api-api-keys-update
// https://ngrok.com/docs/api-reference/apikeys/update
func (c *Client) Update(ctx context.Context, arg *ngrok.APIKeyUpdate) (*ngrok.APIKey, error) {
if arg == nil {
arg = new(ngrok.APIKeyUpdate)
+5 -5
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Get an application session by ID.
//
// https://ngrok.com/docs/api#api-application-sessions-get
// https://ngrok.com/docs/api-reference/applicationsessions/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.ApplicationSession, error) {
arg := &ngrok.Item{ID: id}
@@ -47,7 +47,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.ApplicationSession,
// Delete an application session by ID.
//
// https://ngrok.com/docs/api#api-application-sessions-delete
// https://ngrok.com/docs/api-reference/applicationsessions/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -70,7 +70,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// List all application sessions for this account.
//
// https://ngrok.com/docs/api#api-application-sessions-list
// https://ngrok.com/docs/api-reference/applicationsessions/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.ApplicationSession] {
if paging == nil {
paging = new(ngrok.Paging)
+5 -5
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Get an application user by ID.
//
// https://ngrok.com/docs/api#api-application-users-get
// https://ngrok.com/docs/api-reference/applicationusers/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.ApplicationUser, error) {
arg := &ngrok.Item{ID: id}
@@ -47,7 +47,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.ApplicationUser, er
// Delete an application user by ID.
//
// https://ngrok.com/docs/api#api-application-users-delete
// https://ngrok.com/docs/api-reference/applicationusers/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -70,7 +70,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// List all application users for this account.
//
// https://ngrok.com/docs/api#api-application-users-list
// https://ngrok.com/docs/api-reference/applicationusers/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.ApplicationUser] {
if paging == nil {
paging = new(ngrok.Paging)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// A Failover backend defines failover behavior within a list of referenced
@@ -28,7 +28,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new Failover backend
//
// https://ngrok.com/docs/api#api-failover-backends-create
// https://ngrok.com/docs/api-reference/failoverbackends/create
func (c *Client) Create(ctx context.Context, arg *ngrok.FailoverBackendCreate) (*ngrok.FailoverBackend, error) {
if arg == nil {
arg = new(ngrok.FailoverBackendCreate)
@@ -53,7 +53,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.FailoverBackendCreate) (
// Delete a Failover backend by ID.
//
// https://ngrok.com/docs/api#api-failover-backends-delete
// https://ngrok.com/docs/api-reference/failoverbackends/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -76,7 +76,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about a Failover backend by ID
//
// https://ngrok.com/docs/api#api-failover-backends-get
// https://ngrok.com/docs/api-reference/failoverbackends/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.FailoverBackend, error) {
arg := &ngrok.Item{ID: id}
@@ -100,7 +100,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.FailoverBackend, er
// List all Failover backends on this account
//
// https://ngrok.com/docs/api#api-failover-backends-list
// https://ngrok.com/docs/api-reference/failoverbackends/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.FailoverBackend] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -201,7 +201,7 @@ func (it *iterList) Err() error {
// Update Failover backend by ID
//
// https://ngrok.com/docs/api#api-failover-backends-update
// https://ngrok.com/docs/api-reference/failoverbackends/update
func (c *Client) Update(ctx context.Context, arg *ngrok.FailoverBackendUpdate) (*ngrok.FailoverBackend, error) {
if arg == nil {
arg = new(ngrok.FailoverBackendUpdate)
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// A static backend sends traffic to a TCP address (hostname and port) that
@@ -26,7 +26,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new static backend
//
// https://ngrok.com/docs/api#api-static-backends-create
// https://ngrok.com/docs/api-reference/staticbackends/create
func (c *Client) Create(ctx context.Context, arg *ngrok.StaticBackendCreate) (*ngrok.StaticBackend, error) {
if arg == nil {
arg = new(ngrok.StaticBackendCreate)
@@ -51,7 +51,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.StaticBackendCreate) (*n
// Delete a static backend by ID.
//
// https://ngrok.com/docs/api#api-static-backends-delete
// https://ngrok.com/docs/api-reference/staticbackends/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -74,7 +74,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about a static backend by ID
//
// https://ngrok.com/docs/api#api-static-backends-get
// https://ngrok.com/docs/api-reference/staticbackends/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.StaticBackend, error) {
arg := &ngrok.Item{ID: id}
@@ -98,7 +98,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.StaticBackend, erro
// List all static backends on this account
//
// https://ngrok.com/docs/api#api-static-backends-list
// https://ngrok.com/docs/api-reference/staticbackends/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.StaticBackend] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -199,7 +199,7 @@ func (it *iterList) Err() error {
// Update static backend by ID
//
// https://ngrok.com/docs/api#api-static-backends-update
// https://ngrok.com/docs/api-reference/staticbackends/update
func (c *Client) Update(ctx context.Context, arg *ngrok.StaticBackendUpdate) (*ngrok.StaticBackend, error) {
if arg == nil {
arg = new(ngrok.StaticBackendUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// A Tunnel Group Backend balances traffic among all online tunnels that match
@@ -26,7 +26,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new TunnelGroup backend
//
// https://ngrok.com/docs/api#api-tunnel-group-backends-create
// https://ngrok.com/docs/api-reference/tunnelgroupbackends/create
func (c *Client) Create(ctx context.Context, arg *ngrok.TunnelGroupBackendCreate) (*ngrok.TunnelGroupBackend, error) {
if arg == nil {
arg = new(ngrok.TunnelGroupBackendCreate)
@@ -51,7 +51,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.TunnelGroupBackendCreate
// Delete a TunnelGroup backend by ID.
//
// https://ngrok.com/docs/api#api-tunnel-group-backends-delete
// https://ngrok.com/docs/api-reference/tunnelgroupbackends/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -74,7 +74,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about a TunnelGroup backend by ID
//
// https://ngrok.com/docs/api#api-tunnel-group-backends-get
// https://ngrok.com/docs/api-reference/tunnelgroupbackends/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.TunnelGroupBackend, error) {
arg := &ngrok.Item{ID: id}
@@ -98,7 +98,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.TunnelGroupBackend,
// List all TunnelGroup backends on this account
//
// https://ngrok.com/docs/api#api-tunnel-group-backends-list
// https://ngrok.com/docs/api-reference/tunnelgroupbackends/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.TunnelGroupBackend] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -199,7 +199,7 @@ func (it *iterList) Err() error {
// Update TunnelGroup backend by ID
//
// https://ngrok.com/docs/api#api-tunnel-group-backends-update
// https://ngrok.com/docs/api-reference/tunnelgroupbackends/update
func (c *Client) Update(ctx context.Context, arg *ngrok.TunnelGroupBackendUpdate) (*ngrok.TunnelGroupBackend, error) {
if arg == nil {
arg = new(ngrok.TunnelGroupBackendUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// A Weighted Backend balances traffic among the referenced backends. Traffic
@@ -28,7 +28,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new Weighted backend
//
// https://ngrok.com/docs/api#api-weighted-backends-create
// https://ngrok.com/docs/api-reference/weightedbackends/create
func (c *Client) Create(ctx context.Context, arg *ngrok.WeightedBackendCreate) (*ngrok.WeightedBackend, error) {
if arg == nil {
arg = new(ngrok.WeightedBackendCreate)
@@ -53,7 +53,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.WeightedBackendCreate) (
// Delete a Weighted backend by ID.
//
// https://ngrok.com/docs/api#api-weighted-backends-delete
// https://ngrok.com/docs/api-reference/weightedbackends/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -76,7 +76,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about a Weighted backend by ID
//
// https://ngrok.com/docs/api#api-weighted-backends-get
// https://ngrok.com/docs/api-reference/weightedbackends/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.WeightedBackend, error) {
arg := &ngrok.Item{ID: id}
@@ -100,7 +100,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.WeightedBackend, er
// List all Weighted backends on this account
//
// https://ngrok.com/docs/api#api-weighted-backends-list
// https://ngrok.com/docs/api-reference/weightedbackends/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.WeightedBackend] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -201,7 +201,7 @@ func (it *iterList) Err() error {
// Update Weighted backend by ID
//
// https://ngrok.com/docs/api#api-weighted-backends-update
// https://ngrok.com/docs/api-reference/weightedbackends/update
func (c *Client) Update(ctx context.Context, arg *ngrok.WeightedBackendUpdate) (*ngrok.WeightedBackend, error) {
if arg == nil {
arg = new(ngrok.WeightedBackendUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new bot user
//
// https://ngrok.com/docs/api#api-bot-users-create
// https://ngrok.com/docs/api-reference/botusers/create
func (c *Client) Create(ctx context.Context, arg *ngrok.BotUserCreate) (*ngrok.BotUser, error) {
if arg == nil {
arg = new(ngrok.BotUserCreate)
@@ -48,7 +48,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.BotUserCreate) (*ngrok.B
// Delete a bot user by ID
//
// https://ngrok.com/docs/api#api-bot-users-delete
// https://ngrok.com/docs/api-reference/botusers/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -71,7 +71,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get the details of a Bot User by ID.
//
// https://ngrok.com/docs/api#api-bot-users-get
// https://ngrok.com/docs/api-reference/botusers/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.BotUser, error) {
arg := &ngrok.Item{ID: id}
@@ -95,7 +95,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.BotUser, error) {
// List all bot users in this account.
//
// https://ngrok.com/docs/api#api-bot-users-list
// https://ngrok.com/docs/api-reference/botusers/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.BotUser] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -196,7 +196,7 @@ func (it *iterList) Err() error {
// Update attributes of a bot user by ID.
//
// https://ngrok.com/docs/api#api-bot-users-update
// https://ngrok.com/docs/api-reference/botusers/update
func (c *Client) Update(ctx context.Context, arg *ngrok.BotUserUpdate) (*ngrok.BotUser, error) {
if arg == nil {
arg = new(ngrok.BotUserUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Certificate Authorities are x509 certificates that are used to sign other
@@ -29,7 +29,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Upload a new Certificate Authority
//
// https://ngrok.com/docs/api#api-certificate-authorities-create
// https://ngrok.com/docs/api-reference/certificateauthorities/create
func (c *Client) Create(ctx context.Context, arg *ngrok.CertificateAuthorityCreate) (*ngrok.CertificateAuthority, error) {
var res ngrok.CertificateAuthority
var path bytes.Buffer
@@ -51,7 +51,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.CertificateAuthorityCrea
// Delete a Certificate Authority
//
// https://ngrok.com/docs/api#api-certificate-authorities-delete
// https://ngrok.com/docs/api-reference/certificateauthorities/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -74,7 +74,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about a certificate authority
//
// https://ngrok.com/docs/api#api-certificate-authorities-get
// https://ngrok.com/docs/api-reference/certificateauthorities/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.CertificateAuthority, error) {
arg := &ngrok.Item{ID: id}
@@ -98,7 +98,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.CertificateAuthorit
// List all Certificate Authority on this account
//
// https://ngrok.com/docs/api#api-certificate-authorities-list
// https://ngrok.com/docs/api-reference/certificateauthorities/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.CertificateAuthority] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -202,7 +202,7 @@ func (it *iterList) Err() error {
// Update attributes of a Certificate Authority by ID
//
// https://ngrok.com/docs/api#api-certificate-authorities-update
// https://ngrok.com/docs/api-reference/certificateauthorities/update
func (c *Client) Update(ctx context.Context, arg *ngrok.CertificateAuthorityUpdate) (*ngrok.CertificateAuthority, error) {
if arg == nil {
arg = new(ngrok.CertificateAuthorityUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Tunnel Credentials are ngrok agent authtokens. They authorize the ngrok
@@ -31,7 +31,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// the generated token is available. If you need it for future use, you must save
// it securely yourself.
//
// https://ngrok.com/docs/api#api-credentials-create
// https://ngrok.com/docs/api-reference/credentials/create
func (c *Client) Create(ctx context.Context, arg *ngrok.CredentialCreate) (*ngrok.Credential, error) {
if arg == nil {
arg = new(ngrok.CredentialCreate)
@@ -56,7 +56,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.CredentialCreate) (*ngro
// Delete a tunnel authtoken credential by ID
//
// https://ngrok.com/docs/api#api-credentials-delete
// https://ngrok.com/docs/api-reference/credentials/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -79,7 +79,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about a tunnel authtoken credential
//
// https://ngrok.com/docs/api#api-credentials-get
// https://ngrok.com/docs/api-reference/credentials/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.Credential, error) {
arg := &ngrok.Item{ID: id}
@@ -103,7 +103,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.Credential, error)
// List all tunnel authtoken credentials on this account
//
// https://ngrok.com/docs/api#api-credentials-list
// https://ngrok.com/docs/api-reference/credentials/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.Credential] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -207,7 +207,7 @@ func (it *iterList) Err() error {
// Update attributes of an tunnel authtoken credential by ID
//
// https://ngrok.com/docs/api#api-credentials-update
// https://ngrok.com/docs/api-reference/credentials/update
func (c *Client) Update(ctx context.Context, arg *ngrok.CredentialUpdate) (*ngrok.Credential, error) {
if arg == nil {
arg = new(ngrok.CredentialUpdate)
+1290 -1099
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -23,8 +23,8 @@
// "fmt"
// "math/rand"
//
// "github.com/ngrok/ngrok-api-go/v8"
// "github.com/ngrok/ngrok-api-go/v8/reserved_domains"
// "github.com/ngrok/ngrok-api-go/v9"
// "github.com/ngrok/ngrok-api-go/v9/reserved_domains"
// )
//
// func example(ctx context.Context) error {
@@ -51,9 +51,9 @@
// initialization time.
//
// import (
// "github.com/ngrok/ngrok-api-go/v8"
// "github.com/ngrok/ngrok-api-go/v8/ip_policies"
// "github.com/ngrok/ngrok-api-go/v8/ip_policy_rules"
// "github.com/ngrok/ngrok-api-go/v9"
// "github.com/ngrok/ngrok-api-go/v9/ip_policies"
// "github.com/ngrok/ngrok-api-go/v9/ip_policy_rules"
// )
//
// // Construct the root api Client object
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create an HTTPS Edge
//
// https://ngrok.com/docs/api#api-edges-https-create
// https://ngrok.com/docs/api-reference/edgeshttps/create
func (c *Client) Create(ctx context.Context, arg *ngrok.HTTPSEdgeCreate) (*ngrok.HTTPSEdge, error) {
if arg == nil {
arg = new(ngrok.HTTPSEdgeCreate)
@@ -48,7 +48,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.HTTPSEdgeCreate) (*ngrok
// Get an HTTPS Edge by ID
//
// https://ngrok.com/docs/api#api-edges-https-get
// https://ngrok.com/docs/api-reference/edgeshttps/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.HTTPSEdge, error) {
arg := &ngrok.Item{ID: id}
@@ -72,7 +72,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.HTTPSEdge, error) {
// Returns a list of all HTTPS Edges on this account
//
// https://ngrok.com/docs/api#api-edges-https-list
// https://ngrok.com/docs/api-reference/edgeshttps/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.HTTPSEdge] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -176,7 +176,7 @@ func (it *iterList) Err() error {
// completely replace the existing value. There is no way to delete an existing
// module via this API, instead use the delete module API.
//
// https://ngrok.com/docs/api#api-edges-https-update
// https://ngrok.com/docs/api-reference/edgeshttps/update
func (c *Client) Update(ctx context.Context, arg *ngrok.HTTPSEdgeUpdate) (*ngrok.HTTPSEdge, error) {
if arg == nil {
arg = new(ngrok.HTTPSEdgeUpdate)
@@ -202,7 +202,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.HTTPSEdgeUpdate) (*ngrok
// Delete an HTTPS Edge by ID
//
// https://ngrok.com/docs/api#api-edges-https-delete
// https://ngrok.com/docs/api-reference/edgeshttps/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
+6 -6
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create an HTTPS Edge Route
//
// https://ngrok.com/docs/api#api-edges-https-routes-create
// https://ngrok.com/docs/api-reference/edgeshttpsroutes/create
func (c *Client) Create(ctx context.Context, arg *ngrok.HTTPSEdgeRouteCreate) (*ngrok.HTTPSEdgeRoute, error) {
var res ngrok.HTTPSEdgeRoute
var path bytes.Buffer
@@ -46,7 +46,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.HTTPSEdgeRouteCreate) (*
// Get an HTTPS Edge Route by ID
//
// https://ngrok.com/docs/api#api-edges-https-routes-get
// https://ngrok.com/docs/api-reference/edgeshttpsroutes/get
func (c *Client) Get(ctx context.Context, arg *ngrok.EdgeRouteItem) (*ngrok.HTTPSEdgeRoute, error) {
if arg == nil {
arg = new(ngrok.EdgeRouteItem)
@@ -75,7 +75,7 @@ func (c *Client) Get(ctx context.Context, arg *ngrok.EdgeRouteItem) (*ngrok.HTTP
// will completely replace the existing value. There is no way to delete an
// existing module via this API, instead use the delete module API.
//
// https://ngrok.com/docs/api#api-edges-https-routes-update
// https://ngrok.com/docs/api-reference/edgeshttpsroutes/update
func (c *Client) Update(ctx context.Context, arg *ngrok.HTTPSEdgeRouteUpdate) (*ngrok.HTTPSEdgeRoute, error) {
if arg == nil {
arg = new(ngrok.HTTPSEdgeRouteUpdate)
@@ -102,7 +102,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.HTTPSEdgeRouteUpdate) (*
// Delete an HTTPS Edge Route by ID
//
// https://ngrok.com/docs/api#api-edges-https-routes-delete
// https://ngrok.com/docs/api-reference/edgeshttpsroutes/delete
func (c *Client) Delete(ctx context.Context, arg *ngrok.EdgeRouteItem) error {
if arg == nil {
arg = new(ngrok.EdgeRouteItem)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a TCP Edge
//
// https://ngrok.com/docs/api#api-edges-tcp-create
// https://ngrok.com/docs/api-reference/edgestcp/create
func (c *Client) Create(ctx context.Context, arg *ngrok.TCPEdgeCreate) (*ngrok.TCPEdge, error) {
if arg == nil {
arg = new(ngrok.TCPEdgeCreate)
@@ -48,7 +48,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.TCPEdgeCreate) (*ngrok.T
// Get a TCP Edge by ID
//
// https://ngrok.com/docs/api#api-edges-tcp-get
// https://ngrok.com/docs/api-reference/edgestcp/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.TCPEdge, error) {
arg := &ngrok.Item{ID: id}
@@ -72,7 +72,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.TCPEdge, error) {
// Returns a list of all TCP Edges on this account
//
// https://ngrok.com/docs/api#api-edges-tcp-list
// https://ngrok.com/docs/api-reference/edgestcp/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.TCPEdge] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -176,7 +176,7 @@ func (it *iterList) Err() error {
// completely replace the existing value. There is no way to delete an existing
// module via this API, instead use the delete module API.
//
// https://ngrok.com/docs/api#api-edges-tcp-update
// https://ngrok.com/docs/api-reference/edgestcp/update
func (c *Client) Update(ctx context.Context, arg *ngrok.TCPEdgeUpdate) (*ngrok.TCPEdge, error) {
if arg == nil {
arg = new(ngrok.TCPEdgeUpdate)
@@ -202,7 +202,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.TCPEdgeUpdate) (*ngrok.T
// Delete a TCP Edge by ID
//
// https://ngrok.com/docs/api#api-edges-tcp-delete
// https://ngrok.com/docs/api-reference/edgestcp/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a TLS Edge
//
// https://ngrok.com/docs/api#api-edges-tls-create
// https://ngrok.com/docs/api-reference/edgestls/create
func (c *Client) Create(ctx context.Context, arg *ngrok.TLSEdgeCreate) (*ngrok.TLSEdge, error) {
if arg == nil {
arg = new(ngrok.TLSEdgeCreate)
@@ -48,7 +48,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.TLSEdgeCreate) (*ngrok.T
// Get a TLS Edge by ID
//
// https://ngrok.com/docs/api#api-edges-tls-get
// https://ngrok.com/docs/api-reference/edgestls/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.TLSEdge, error) {
arg := &ngrok.Item{ID: id}
@@ -72,7 +72,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.TLSEdge, error) {
// Returns a list of all TLS Edges on this account
//
// https://ngrok.com/docs/api#api-edges-tls-list
// https://ngrok.com/docs/api-reference/edgestls/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.TLSEdge] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -176,7 +176,7 @@ func (it *iterList) Err() error {
// completely replace the existing value. There is no way to delete an existing
// module via this API, instead use the delete module API.
//
// https://ngrok.com/docs/api#api-edges-tls-update
// https://ngrok.com/docs/api-reference/edgestls/update
func (c *Client) Update(ctx context.Context, arg *ngrok.TLSEdgeUpdate) (*ngrok.TLSEdge, error) {
if arg == nil {
arg = new(ngrok.TLSEdgeUpdate)
@@ -202,7 +202,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.TLSEdgeUpdate) (*ngrok.T
// Delete a TLS Edge by ID
//
// https://ngrok.com/docs/api#api-edges-tls-delete
// https://ngrok.com/docs/api-reference/edgestls/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Endpoints provides an API for querying the endpoint objects
@@ -27,7 +27,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create an endpoint, currently available only for cloud endpoints
//
// https://ngrok.com/docs/api#api-endpoints-create
// https://ngrok.com/docs/api-reference/endpoints/create
func (c *Client) Create(ctx context.Context, arg *ngrok.EndpointCreate) (*ngrok.Endpoint, error) {
var res ngrok.Endpoint
var path bytes.Buffer
@@ -49,7 +49,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.EndpointCreate) (*ngrok.
// List all active endpoints on the account
//
// https://ngrok.com/docs/api#api-endpoints-list
// https://ngrok.com/docs/api-reference/endpoints/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.Endpoint] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -150,7 +150,7 @@ func (it *iterList) Err() error {
// Get the status of an endpoint by ID
//
// https://ngrok.com/docs/api#api-endpoints-get
// https://ngrok.com/docs/api-reference/endpoints/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.Endpoint, error) {
arg := &ngrok.Item{ID: id}
@@ -174,7 +174,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.Endpoint, error) {
// Update an Endpoint by ID, currently available only for cloud endpoints
//
// https://ngrok.com/docs/api#api-endpoints-update
// https://ngrok.com/docs/api-reference/endpoints/update
func (c *Client) Update(ctx context.Context, arg *ngrok.EndpointUpdate) (*ngrok.Endpoint, error) {
if arg == nil {
arg = new(ngrok.EndpointUpdate)
@@ -200,7 +200,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.EndpointUpdate) (*ngrok.
// Delete an Endpoint by ID, currently available only for cloud endpoints
//
// https://ngrok.com/docs/api#api-endpoints-delete
// https://ngrok.com/docs/api-reference/endpoints/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -24,7 +24,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new Event Destination. It will not apply to anything until it is
// associated with an Event Subscription.
//
// https://ngrok.com/docs/api#api-event-destinations-create
// https://ngrok.com/docs/api-reference/eventdestinations/create
func (c *Client) Create(ctx context.Context, arg *ngrok.EventDestinationCreate) (*ngrok.EventDestination, error) {
if arg == nil {
arg = new(ngrok.EventDestinationCreate)
@@ -50,7 +50,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.EventDestinationCreate)
// Delete an Event Destination. If the Event Destination is still referenced by an
// Event Subscription.
//
// https://ngrok.com/docs/api#api-event-destinations-delete
// https://ngrok.com/docs/api-reference/eventdestinations/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -73,7 +73,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about an Event Destination by ID.
//
// https://ngrok.com/docs/api#api-event-destinations-get
// https://ngrok.com/docs/api-reference/eventdestinations/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.EventDestination, error) {
arg := &ngrok.Item{ID: id}
@@ -97,7 +97,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.EventDestination, e
// List all Event Destinations on this account.
//
// https://ngrok.com/docs/api#api-event-destinations-list
// https://ngrok.com/docs/api-reference/eventdestinations/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.EventDestination] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -201,7 +201,7 @@ func (it *iterList) Err() error {
// Update attributes of an Event Destination.
//
// https://ngrok.com/docs/api#api-event-destinations-update
// https://ngrok.com/docs/api-reference/eventdestinations/update
func (c *Client) Update(ctx context.Context, arg *ngrok.EventDestinationUpdate) (*ngrok.EventDestination, error) {
if arg == nil {
arg = new(ngrok.EventDestinationUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Add an additional type for which this event subscription will trigger
//
// https://ngrok.com/docs/api#api-event-sources-create
// https://ngrok.com/docs/api-reference/eventsources/create
func (c *Client) Create(ctx context.Context, arg *ngrok.EventSourceCreate) (*ngrok.EventSource, error) {
if arg == nil {
arg = new(ngrok.EventSourceCreate)
@@ -49,7 +49,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.EventSourceCreate) (*ngr
// Remove a type for which this event subscription will trigger
//
// https://ngrok.com/docs/api#api-event-sources-delete
// https://ngrok.com/docs/api-reference/eventsources/delete
func (c *Client) Delete(ctx context.Context, arg *ngrok.EventSourceItem) error {
if arg == nil {
arg = new(ngrok.EventSourceItem)
@@ -74,7 +74,7 @@ func (c *Client) Delete(ctx context.Context, arg *ngrok.EventSourceItem) error {
// Get the details for a given type that triggers for the given event subscription
//
// https://ngrok.com/docs/api#api-event-sources-get
// https://ngrok.com/docs/api-reference/eventsources/get
func (c *Client) Get(ctx context.Context, arg *ngrok.EventSourceItem) (*ngrok.EventSource, error) {
if arg == nil {
arg = new(ngrok.EventSourceItem)
@@ -100,7 +100,7 @@ func (c *Client) Get(ctx context.Context, arg *ngrok.EventSourceItem) (*ngrok.Ev
// List the types for which this event subscription will trigger
//
// https://ngrok.com/docs/api#api-event-sources-list
// https://ngrok.com/docs/api-reference/eventsources/list
func (c *Client) List(ctx context.Context, subscriptionId string) (*ngrok.EventSourceList, error) {
arg := &ngrok.EventSourcePaging{SubscriptionID: subscriptionId}
@@ -124,7 +124,7 @@ func (c *Client) List(ctx context.Context, subscriptionId string) (*ngrok.EventS
// Update the type for which this event subscription will trigger
//
// https://ngrok.com/docs/api#api-event-sources-update
// https://ngrok.com/docs/api-reference/eventsources/update
func (c *Client) Update(ctx context.Context, arg *ngrok.EventSourceUpdate) (*ngrok.EventSource, error) {
if arg == nil {
arg = new(ngrok.EventSourceUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create an Event Subscription.
//
// https://ngrok.com/docs/api#api-event-subscriptions-create
// https://ngrok.com/docs/api-reference/eventsubscriptions/create
func (c *Client) Create(ctx context.Context, arg *ngrok.EventSubscriptionCreate) (*ngrok.EventSubscription, error) {
if arg == nil {
arg = new(ngrok.EventSubscriptionCreate)
@@ -48,7 +48,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.EventSubscriptionCreate)
// Delete an Event Subscription.
//
// https://ngrok.com/docs/api#api-event-subscriptions-delete
// https://ngrok.com/docs/api-reference/eventsubscriptions/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -71,7 +71,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get an Event Subscription by ID.
//
// https://ngrok.com/docs/api#api-event-subscriptions-get
// https://ngrok.com/docs/api-reference/eventsubscriptions/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.EventSubscription, error) {
arg := &ngrok.Item{ID: id}
@@ -95,7 +95,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.EventSubscription,
// List this Account's Event Subscriptions.
//
// https://ngrok.com/docs/api#api-event-subscriptions-list
// https://ngrok.com/docs/api-reference/eventsubscriptions/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.EventSubscription] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -199,7 +199,7 @@ func (it *iterList) Err() error {
// Update an Event Subscription.
//
// https://ngrok.com/docs/api#api-event-subscriptions-update
// https://ngrok.com/docs/api-reference/eventsubscriptions/update
func (c *Client) Update(ctx context.Context, arg *ngrok.EventSubscriptionUpdate) (*ngrok.EventSubscription, error) {
if arg == nil {
arg = new(ngrok.EventSubscriptionUpdate)
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated for API Clients. DO NOT EDIT.
module github.com/ngrok/ngrok-api-go/v8
module github.com/ngrok/ngrok-api-go/v9
go 1.25
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"os"
"testing"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/ip_policies"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/ip_policies"
"github.com/stretchr/testify/require"
)
+1 -1
View File
@@ -2,7 +2,7 @@
package api
import "github.com/ngrok/ngrok-api-go/v8"
import "github.com/ngrok/ngrok-api-go/v9"
type Client = ngrok.BaseClient
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// IP Policies are reusable groups of CIDR ranges with an allow or deny
@@ -29,7 +29,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// 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.
//
// https://ngrok.com/docs/api#api-ip-policies-create
// https://ngrok.com/docs/api-reference/ippolicies/create
func (c *Client) Create(ctx context.Context, arg *ngrok.IPPolicyCreate) (*ngrok.IPPolicy, error) {
if arg == nil {
arg = new(ngrok.IPPolicyCreate)
@@ -56,7 +56,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.IPPolicyCreate) (*ngrok.
// purposes of traffic restriction it will be treated as if the IP policy remains
// but has zero rules.
//
// https://ngrok.com/docs/api#api-ip-policies-delete
// https://ngrok.com/docs/api-reference/ippolicies/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -79,7 +79,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about an IP policy by ID.
//
// https://ngrok.com/docs/api#api-ip-policies-get
// https://ngrok.com/docs/api-reference/ippolicies/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.IPPolicy, error) {
arg := &ngrok.Item{ID: id}
@@ -103,7 +103,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.IPPolicy, error) {
// List all IP policies on this account
//
// https://ngrok.com/docs/api#api-ip-policies-list
// https://ngrok.com/docs/api-reference/ippolicies/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.IPPolicy] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -207,7 +207,7 @@ func (it *iterList) Err() error {
// Update attributes of an IP policy by ID
//
// https://ngrok.com/docs/api#api-ip-policies-update
// https://ngrok.com/docs/api-reference/ippolicies/update
func (c *Client) Update(ctx context.Context, arg *ngrok.IPPolicyUpdate) (*ngrok.IPPolicy, error) {
if arg == nil {
arg = new(ngrok.IPPolicyUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// IP Policy Rules are the IPv4 or IPv6 CIDRs entries that
@@ -26,7 +26,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new IP policy rule attached to an IP Policy.
//
// https://ngrok.com/docs/api#api-ip-policy-rules-create
// https://ngrok.com/docs/api-reference/ippolicyrules/create
func (c *Client) Create(ctx context.Context, arg *ngrok.IPPolicyRuleCreate) (*ngrok.IPPolicyRule, error) {
var res ngrok.IPPolicyRule
var path bytes.Buffer
@@ -48,7 +48,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.IPPolicyRuleCreate) (*ng
// Delete an IP policy rule.
//
// https://ngrok.com/docs/api#api-ip-policy-rules-delete
// https://ngrok.com/docs/api-reference/ippolicyrules/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -71,7 +71,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about an IP policy rule by ID.
//
// https://ngrok.com/docs/api#api-ip-policy-rules-get
// https://ngrok.com/docs/api-reference/ippolicyrules/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.IPPolicyRule, error) {
arg := &ngrok.Item{ID: id}
@@ -95,7 +95,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.IPPolicyRule, error
// List all IP policy rules on this account
//
// https://ngrok.com/docs/api#api-ip-policy-rules-list
// https://ngrok.com/docs/api-reference/ippolicyrules/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.IPPolicyRule] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -199,7 +199,7 @@ func (it *iterList) Err() error {
// Update attributes of an IP policy rule by ID
//
// https://ngrok.com/docs/api#api-ip-policy-rules-update
// https://ngrok.com/docs/api-reference/ippolicyrules/update
func (c *Client) Update(ctx context.Context, arg *ngrok.IPPolicyRuleUpdate) (*ngrok.IPPolicyRule, error) {
if arg == nil {
arg = new(ngrok.IPPolicyRuleUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// An IP restriction is a restriction placed on the CIDRs that are allowed to
@@ -30,7 +30,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new IP restriction
//
// https://ngrok.com/docs/api#api-ip-restrictions-create
// https://ngrok.com/docs/api-reference/iprestrictions/create
func (c *Client) Create(ctx context.Context, arg *ngrok.IPRestrictionCreate) (*ngrok.IPRestriction, error) {
var res ngrok.IPRestriction
var path bytes.Buffer
@@ -52,7 +52,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.IPRestrictionCreate) (*n
// Delete an IP restriction
//
// https://ngrok.com/docs/api#api-ip-restrictions-delete
// https://ngrok.com/docs/api-reference/iprestrictions/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -75,7 +75,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about an IP restriction
//
// https://ngrok.com/docs/api#api-ip-restrictions-get
// https://ngrok.com/docs/api-reference/iprestrictions/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.IPRestriction, error) {
arg := &ngrok.Item{ID: id}
@@ -99,7 +99,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.IPRestriction, erro
// List all IP restrictions on this account
//
// https://ngrok.com/docs/api#api-ip-restrictions-list
// https://ngrok.com/docs/api-reference/iprestrictions/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.IPRestriction] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -203,7 +203,7 @@ func (it *iterList) Err() error {
// Update attributes of an IP restriction by ID
//
// https://ngrok.com/docs/api#api-ip-restrictions-update
// https://ngrok.com/docs/api-reference/iprestrictions/update
func (c *Client) Update(ctx context.Context, arg *ngrok.IPRestrictionUpdate) (*ngrok.IPRestriction, error) {
if arg == nil {
arg = new(ngrok.IPRestrictionUpdate)
+8 -8
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// KubernetesOperators is used by the Kubernetes Operator to register and
@@ -27,7 +27,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new Kubernetes Operator
//
// https://ngrok.com/docs/api#api-kubernetes-operators-create
// https://ngrok.com/docs/api-reference/kubernetesoperators/create
func (c *Client) Create(ctx context.Context, arg *ngrok.KubernetesOperatorCreate) (*ngrok.KubernetesOperator, error) {
if arg == nil {
arg = new(ngrok.KubernetesOperatorCreate)
@@ -52,7 +52,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.KubernetesOperatorCreate
// Update an existing Kubernetes operator by ID.
//
// https://ngrok.com/docs/api#api-kubernetes-operators-update
// https://ngrok.com/docs/api-reference/kubernetesoperators/update
func (c *Client) Update(ctx context.Context, arg *ngrok.KubernetesOperatorUpdate) (*ngrok.KubernetesOperator, error) {
if arg == nil {
arg = new(ngrok.KubernetesOperatorUpdate)
@@ -78,7 +78,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.KubernetesOperatorUpdate
// Delete a Kubernetes Operator
//
// https://ngrok.com/docs/api#api-kubernetes-operators-delete
// https://ngrok.com/docs/api-reference/kubernetesoperators/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -101,7 +101,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get of a Kubernetes Operator
//
// https://ngrok.com/docs/api#api-kubernetes-operators-get
// https://ngrok.com/docs/api-reference/kubernetesoperators/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.KubernetesOperator, error) {
arg := &ngrok.Item{ID: id}
@@ -125,7 +125,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.KubernetesOperator,
// List all Kubernetes Operators owned by this account
//
// https://ngrok.com/docs/api#api-kubernetes-operators-list
// https://ngrok.com/docs/api-reference/kubernetesoperators/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.KubernetesOperator] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -226,7 +226,7 @@ func (it *iterList) Err() error {
// List Endpoints bound to a Kubernetes Operator
//
// https://ngrok.com/docs/api#api-kubernetes-operators-get-bound-endpoints
// https://ngrok.com/docs/api-reference/kubernetesoperators/get-bound-endpoints
func (c *Client) GetBoundEndpoints(id string, paging *ngrok.Paging) ngrok.Iter[*ngrok.Endpoint] {
arg := &ngrok.ItemPaging{ID: id}
if paging == nil {
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Reserved Addresses are TCP addresses that can be used to listen for traffic.
@@ -27,7 +27,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new reserved address.
//
// https://ngrok.com/docs/api#api-reserved-addrs-create
// https://ngrok.com/docs/api-reference/reservedaddrs/create
func (c *Client) Create(ctx context.Context, arg *ngrok.ReservedAddrCreate) (*ngrok.ReservedAddr, error) {
if arg == nil {
arg = new(ngrok.ReservedAddrCreate)
@@ -52,7 +52,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.ReservedAddrCreate) (*ng
// Delete a reserved address.
//
// https://ngrok.com/docs/api#api-reserved-addrs-delete
// https://ngrok.com/docs/api-reference/reservedaddrs/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -75,7 +75,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get the details of a reserved address.
//
// https://ngrok.com/docs/api#api-reserved-addrs-get
// https://ngrok.com/docs/api-reference/reservedaddrs/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.ReservedAddr, error) {
arg := &ngrok.Item{ID: id}
@@ -99,7 +99,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.ReservedAddr, error
// List all reserved addresses on this account.
//
// https://ngrok.com/docs/api#api-reserved-addrs-list
// https://ngrok.com/docs/api-reference/reservedaddrs/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.ReservedAddr] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -203,7 +203,7 @@ func (it *iterList) Err() error {
// Update the attributes of a reserved address.
//
// https://ngrok.com/docs/api#api-reserved-addrs-update
// https://ngrok.com/docs/api-reference/reservedaddrs/update
func (c *Client) Update(ctx context.Context, arg *ngrok.ReservedAddrUpdate) (*ngrok.ReservedAddr, error) {
if arg == nil {
arg = new(ngrok.ReservedAddrUpdate)
+9 -9
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Reserved Domains are hostnames that you can listen for traffic on. Domains
@@ -28,7 +28,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new reserved domain.
//
// https://ngrok.com/docs/api#api-reserved-domains-create
// https://ngrok.com/docs/api-reference/reserveddomains/create
func (c *Client) Create(ctx context.Context, arg *ngrok.ReservedDomainCreate) (*ngrok.ReservedDomain, error) {
if arg == nil {
arg = new(ngrok.ReservedDomainCreate)
@@ -53,7 +53,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.ReservedDomainCreate) (*
// Delete a reserved domain.
//
// https://ngrok.com/docs/api#api-reserved-domains-delete
// https://ngrok.com/docs/api-reference/reserveddomains/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -76,7 +76,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get the details of a reserved domain.
//
// https://ngrok.com/docs/api#api-reserved-domains-get
// https://ngrok.com/docs/api-reference/reserveddomains/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.ReservedDomain, error) {
arg := &ngrok.Item{ID: id}
@@ -100,7 +100,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.ReservedDomain, err
// List all reserved domains on this account.
//
// https://ngrok.com/docs/api#api-reserved-domains-list
// https://ngrok.com/docs/api-reference/reserveddomains/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.ReservedDomain] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -204,7 +204,7 @@ func (it *iterList) Err() error {
// Update the attributes of a reserved domain.
//
// https://ngrok.com/docs/api#api-reserved-domains-update
// https://ngrok.com/docs/api-reference/reserveddomains/update
func (c *Client) Update(ctx context.Context, arg *ngrok.ReservedDomainUpdate) (*ngrok.ReservedDomain, error) {
if arg == nil {
arg = new(ngrok.ReservedDomainUpdate)
@@ -230,7 +230,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.ReservedDomainUpdate) (*
// Detach the certificate management policy attached to a reserved domain.
//
// https://ngrok.com/docs/api#api-reserved-domains-delete-certificate-management-policy
// https://ngrok.com/docs/api-reference/reserveddomains/delete-certificate-management-policy
func (c *Client) DeleteCertificateManagementPolicy(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -253,7 +253,7 @@ func (c *Client) DeleteCertificateManagementPolicy(ctx context.Context, id strin
// Detach the certificate attached to a reserved domain.
//
// https://ngrok.com/docs/api#api-reserved-domains-delete-certificate
// https://ngrok.com/docs/api-reference/reserveddomains/delete-certificate
func (c *Client) DeleteCertificate(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Secrets is an api service for securely storing and managing sensitive data such
@@ -26,7 +26,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new Secret
//
// https://ngrok.com/docs/api#api-secrets-create
// https://ngrok.com/docs/api-reference/secrets/create
func (c *Client) Create(ctx context.Context, arg *ngrok.SecretCreate) (*ngrok.Secret, error) {
if arg == nil {
arg = new(ngrok.SecretCreate)
@@ -51,7 +51,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.SecretCreate) (*ngrok.Se
// Update an existing Secret by ID
//
// https://ngrok.com/docs/api#api-secrets-update
// https://ngrok.com/docs/api-reference/secrets/update
func (c *Client) Update(ctx context.Context, arg *ngrok.SecretUpdate) (*ngrok.Secret, error) {
if arg == nil {
arg = new(ngrok.SecretUpdate)
@@ -77,7 +77,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.SecretUpdate) (*ngrok.Se
// Delete a Secret
//
// https://ngrok.com/docs/api#api-secrets-delete
// https://ngrok.com/docs/api-reference/secrets/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -100,7 +100,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get a Secret by ID
//
// https://ngrok.com/docs/api#api-secrets-get
// https://ngrok.com/docs/api-reference/secrets/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.Secret, error) {
arg := &ngrok.Item{ID: id}
@@ -124,7 +124,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.Secret, error) {
// List all Secrets owned by account
//
// https://ngrok.com/docs/api#api-secrets-list
// https://ngrok.com/docs/api-reference/secrets/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.Secret] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
type Client struct {
@@ -23,7 +23,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new service user
//
// https://ngrok.com/docs/api#api-service-users-create
// https://ngrok.com/docs/api-reference/serviceusers/create
func (c *Client) Create(ctx context.Context, arg *ngrok.ServiceUserCreate) (*ngrok.ServiceUser, error) {
if arg == nil {
arg = new(ngrok.ServiceUserCreate)
@@ -48,7 +48,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.ServiceUserCreate) (*ngr
// Delete a service user by ID
//
// https://ngrok.com/docs/api#api-service-users-delete
// https://ngrok.com/docs/api-reference/serviceusers/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -71,7 +71,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get the details of a Bot User by ID.
//
// https://ngrok.com/docs/api#api-service-users-get
// https://ngrok.com/docs/api-reference/serviceusers/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.ServiceUser, error) {
arg := &ngrok.Item{ID: id}
@@ -95,7 +95,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.ServiceUser, error)
// List all service users in this account.
//
// https://ngrok.com/docs/api#api-service-users-list
// https://ngrok.com/docs/api-reference/serviceusers/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.ServiceUser] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -199,7 +199,7 @@ func (it *iterList) Err() error {
// Update attributes of a service user by ID.
//
// https://ngrok.com/docs/api#api-service-users-update
// https://ngrok.com/docs/api-reference/serviceusers/update
func (c *Client) Update(ctx context.Context, arg *ngrok.ServiceUserUpdate) (*ngrok.ServiceUser, error) {
if arg == nil {
arg = new(ngrok.ServiceUserUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// An SSH Certificate Authority is a pair of an SSH Certificate and its private
@@ -26,7 +26,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new SSH Certificate Authority
//
// https://ngrok.com/docs/api#api-ssh-certificate-authorities-create
// https://ngrok.com/docs/api-reference/sshcertificateauthorities/create
func (c *Client) Create(ctx context.Context, arg *ngrok.SSHCertificateAuthorityCreate) (*ngrok.SSHCertificateAuthority, error) {
if arg == nil {
arg = new(ngrok.SSHCertificateAuthorityCreate)
@@ -51,7 +51,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.SSHCertificateAuthorityC
// Delete an SSH Certificate Authority
//
// https://ngrok.com/docs/api#api-ssh-certificate-authorities-delete
// https://ngrok.com/docs/api-reference/sshcertificateauthorities/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -74,7 +74,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about an SSH Certificate Authority
//
// https://ngrok.com/docs/api#api-ssh-certificate-authorities-get
// https://ngrok.com/docs/api-reference/sshcertificateauthorities/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.SSHCertificateAuthority, error) {
arg := &ngrok.Item{ID: id}
@@ -98,7 +98,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.SSHCertificateAutho
// List all SSH Certificate Authorities on this account
//
// https://ngrok.com/docs/api#api-ssh-certificate-authorities-list
// https://ngrok.com/docs/api-reference/sshcertificateauthorities/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.SSHCertificateAuthority] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -202,7 +202,7 @@ func (it *iterList) Err() error {
// Update an SSH Certificate Authority
//
// https://ngrok.com/docs/api#api-ssh-certificate-authorities-update
// https://ngrok.com/docs/api-reference/sshcertificateauthorities/update
func (c *Client) Update(ctx context.Context, arg *ngrok.SSHCertificateAuthorityUpdate) (*ngrok.SSHCertificateAuthority, error) {
if arg == nil {
arg = new(ngrok.SSHCertificateAuthorityUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// SSH Credentials are SSH public keys that can be used to start SSH tunnels
@@ -27,7 +27,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new ssh_credential from an uploaded public SSH key. This ssh credential
// can be used to start new tunnels via ngrok's SSH gateway.
//
// https://ngrok.com/docs/api#api-ssh-credentials-create
// https://ngrok.com/docs/api-reference/sshcredentials/create
func (c *Client) Create(ctx context.Context, arg *ngrok.SSHCredentialCreate) (*ngrok.SSHCredential, error) {
var res ngrok.SSHCredential
var path bytes.Buffer
@@ -49,7 +49,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.SSHCredentialCreate) (*n
// Delete an ssh_credential by ID
//
// https://ngrok.com/docs/api#api-ssh-credentials-delete
// https://ngrok.com/docs/api-reference/sshcredentials/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -72,7 +72,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about an ssh_credential
//
// https://ngrok.com/docs/api#api-ssh-credentials-get
// https://ngrok.com/docs/api-reference/sshcredentials/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.SSHCredential, error) {
arg := &ngrok.Item{ID: id}
@@ -96,7 +96,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.SSHCredential, erro
// List all ssh credentials on this account
//
// https://ngrok.com/docs/api#api-ssh-credentials-list
// https://ngrok.com/docs/api-reference/sshcredentials/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.SSHCredential] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -200,7 +200,7 @@ func (it *iterList) Err() error {
// Update attributes of an ssh_credential by ID
//
// https://ngrok.com/docs/api#api-ssh-credentials-update
// https://ngrok.com/docs/api-reference/sshcredentials/update
func (c *Client) Update(ctx context.Context, arg *ngrok.SSHCredentialUpdate) (*ngrok.SSHCredential, error) {
if arg == nil {
arg = new(ngrok.SSHCredentialUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// SSH Host Certificates along with the corresponding private key allows an SSH
@@ -27,7 +27,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new SSH Host Certificate
//
// https://ngrok.com/docs/api#api-ssh-host-certificates-create
// https://ngrok.com/docs/api-reference/sshhostcertificates/create
func (c *Client) Create(ctx context.Context, arg *ngrok.SSHHostCertificateCreate) (*ngrok.SSHHostCertificate, error) {
var res ngrok.SSHHostCertificate
var path bytes.Buffer
@@ -49,7 +49,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.SSHHostCertificateCreate
// Delete an SSH Host Certificate
//
// https://ngrok.com/docs/api#api-ssh-host-certificates-delete
// https://ngrok.com/docs/api-reference/sshhostcertificates/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -72,7 +72,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about an SSH Host Certificate
//
// https://ngrok.com/docs/api#api-ssh-host-certificates-get
// https://ngrok.com/docs/api-reference/sshhostcertificates/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.SSHHostCertificate, error) {
arg := &ngrok.Item{ID: id}
@@ -96,7 +96,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.SSHHostCertificate,
// List all SSH Host Certificates issued on this account
//
// https://ngrok.com/docs/api#api-ssh-host-certificates-list
// https://ngrok.com/docs/api-reference/sshhostcertificates/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.SSHHostCertificate] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -197,7 +197,7 @@ func (it *iterList) Err() error {
// Update an SSH Host Certificate
//
// https://ngrok.com/docs/api#api-ssh-host-certificates-update
// https://ngrok.com/docs/api-reference/sshhostcertificates/update
func (c *Client) Update(ctx context.Context, arg *ngrok.SSHHostCertificateUpdate) (*ngrok.SSHHostCertificate, error) {
if arg == nil {
arg = new(ngrok.SSHHostCertificateUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// SSH User Certificates are presented by SSH clients when connecting to an SSH
@@ -27,7 +27,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new SSH User Certificate
//
// https://ngrok.com/docs/api#api-ssh-user-certificates-create
// https://ngrok.com/docs/api-reference/sshusercertificates/create
func (c *Client) Create(ctx context.Context, arg *ngrok.SSHUserCertificateCreate) (*ngrok.SSHUserCertificate, error) {
var res ngrok.SSHUserCertificate
var path bytes.Buffer
@@ -49,7 +49,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.SSHUserCertificateCreate
// Delete an SSH User Certificate
//
// https://ngrok.com/docs/api#api-ssh-user-certificates-delete
// https://ngrok.com/docs/api-reference/sshusercertificates/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -72,7 +72,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about an SSH User Certificate
//
// https://ngrok.com/docs/api#api-ssh-user-certificates-get
// https://ngrok.com/docs/api-reference/sshusercertificates/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.SSHUserCertificate, error) {
arg := &ngrok.Item{ID: id}
@@ -96,7 +96,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.SSHUserCertificate,
// List all SSH User Certificates issued on this account
//
// https://ngrok.com/docs/api#api-ssh-user-certificates-list
// https://ngrok.com/docs/api-reference/sshusercertificates/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.SSHUserCertificate] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -197,7 +197,7 @@ func (it *iterList) Err() error {
// Update an SSH User Certificate
//
// https://ngrok.com/docs/api#api-ssh-user-certificates-update
// https://ngrok.com/docs/api-reference/sshusercertificates/update
func (c *Client) Update(ctx context.Context, arg *ngrok.SSHUserCertificateUpdate) (*ngrok.SSHUserCertificate, error) {
if arg == nil {
arg = new(ngrok.SSHUserCertificateUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// TLS Certificates are pairs of x509 certificates and their matching private
@@ -29,7 +29,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Upload a new TLS certificate
//
// https://ngrok.com/docs/api#api-tls-certificates-create
// https://ngrok.com/docs/api-reference/tlscertificates/create
func (c *Client) Create(ctx context.Context, arg *ngrok.TLSCertificateCreate) (*ngrok.TLSCertificate, error) {
var res ngrok.TLSCertificate
var path bytes.Buffer
@@ -51,7 +51,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.TLSCertificateCreate) (*
// Delete a TLS certificate
//
// https://ngrok.com/docs/api#api-tls-certificates-delete
// https://ngrok.com/docs/api-reference/tlscertificates/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -74,7 +74,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get detailed information about a TLS certificate
//
// https://ngrok.com/docs/api#api-tls-certificates-get
// https://ngrok.com/docs/api-reference/tlscertificates/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.TLSCertificate, error) {
arg := &ngrok.Item{ID: id}
@@ -98,7 +98,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.TLSCertificate, err
// List all TLS certificates on this account
//
// https://ngrok.com/docs/api#api-tls-certificates-list
// https://ngrok.com/docs/api-reference/tlscertificates/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.TLSCertificate] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -202,7 +202,7 @@ func (it *iterList) Err() error {
// Update attributes of a TLS Certificate by ID
//
// https://ngrok.com/docs/api#api-tls-certificates-update
// https://ngrok.com/docs/api-reference/tlscertificates/update
func (c *Client) Update(ctx context.Context, arg *ngrok.TLSCertificateUpdate) (*ngrok.TLSCertificate, error) {
if arg == nil {
arg = new(ngrok.TLSCertificateUpdate)
+7 -7
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Tunnel Sessions represent instances of ngrok agents or SSH reverse tunnel
@@ -27,7 +27,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// List all online tunnel sessions running on this account.
//
// https://ngrok.com/docs/api#api-tunnel-sessions-list
// https://ngrok.com/docs/api-reference/tunnelsessions/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.TunnelSession] {
if paging == nil {
paging = new(ngrok.FilteredPaging)
@@ -131,7 +131,7 @@ func (it *iterList) Err() error {
// Get the detailed status of a tunnel session by ID
//
// https://ngrok.com/docs/api#api-tunnel-sessions-get
// https://ngrok.com/docs/api-reference/tunnelsessions/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.TunnelSession, error) {
arg := &ngrok.Item{ID: id}
@@ -158,7 +158,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.TunnelSession, erro
// not supported on Windows. When an agent restarts, it reconnects with a new
// tunnel session ID.
//
// https://ngrok.com/docs/api#api-tunnel-sessions-restart
// https://ngrok.com/docs/api-reference/tunnelsessions/restart
func (c *Client) Restart(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -183,7 +183,7 @@ func (c *Client) Restart(ctx context.Context, id string) error {
// Issues a command instructing the ngrok agent that started this tunnel session to
// exit.
//
// https://ngrok.com/docs/api#api-tunnel-sessions-stop
// https://ngrok.com/docs/api-reference/tunnelsessions/stop
func (c *Client) Stop(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -218,7 +218,7 @@ func (c *Client) Stop(ctx context.Context, id string) error {
// disabled update checks the agent is currently in process of updating the agent
// has already successfully updated but has not yet been restarted
//
// https://ngrok.com/docs/api#api-tunnel-sessions-update
// https://ngrok.com/docs/api-reference/tunnelsessions/update
func (c *Client) Update(ctx context.Context, id string) error {
arg := &ngrok.TunnelSessionsUpdate{ID: id}
+4 -4
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Tunnels provide endpoints to access services exposed by a running ngrok
@@ -26,7 +26,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// List all online tunnels currently running on the account.
//
// https://ngrok.com/docs/api#api-tunnels-list
// https://ngrok.com/docs/api-reference/tunnels/list
func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.Tunnel] {
if paging == nil {
paging = new(ngrok.Paging)
@@ -127,7 +127,7 @@ func (it *iterList) Err() error {
// Get the status of a tunnel by ID
//
// https://ngrok.com/docs/api#api-tunnels-get
// https://ngrok.com/docs/api-reference/tunnels/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.Tunnel, error) {
arg := &ngrok.Item{ID: id}
+8 -8
View File
@@ -9,8 +9,8 @@ import (
"net/url"
"text/template"
"github.com/ngrok/ngrok-api-go/v8"
"github.com/ngrok/ngrok-api-go/v8/internal/api"
"github.com/ngrok/ngrok-api-go/v9"
"github.com/ngrok/ngrok-api-go/v9/internal/api"
)
// Vaults is an api service for securely storing and managing sensitive data such
@@ -26,7 +26,7 @@ func NewClient(cfg *ngrok.ClientConfig) *Client {
// Create a new Vault
//
// https://ngrok.com/docs/api#api-vaults-create
// https://ngrok.com/docs/api-reference/vaults/create
func (c *Client) Create(ctx context.Context, arg *ngrok.VaultCreate) (*ngrok.Vault, error) {
if arg == nil {
arg = new(ngrok.VaultCreate)
@@ -51,7 +51,7 @@ func (c *Client) Create(ctx context.Context, arg *ngrok.VaultCreate) (*ngrok.Vau
// Update an existing Vault by ID
//
// https://ngrok.com/docs/api#api-vaults-update
// https://ngrok.com/docs/api-reference/vaults/update
func (c *Client) Update(ctx context.Context, arg *ngrok.VaultUpdate) (*ngrok.Vault, error) {
if arg == nil {
arg = new(ngrok.VaultUpdate)
@@ -77,7 +77,7 @@ func (c *Client) Update(ctx context.Context, arg *ngrok.VaultUpdate) (*ngrok.Vau
// Delete a Vault
//
// https://ngrok.com/docs/api#api-vaults-delete
// https://ngrok.com/docs/api-reference/vaults/delete
func (c *Client) Delete(ctx context.Context, id string) error {
arg := &ngrok.Item{ID: id}
@@ -100,7 +100,7 @@ func (c *Client) Delete(ctx context.Context, id string) error {
// Get a Vault by ID
//
// https://ngrok.com/docs/api#api-vaults-get
// https://ngrok.com/docs/api-reference/vaults/get
func (c *Client) Get(ctx context.Context, id string) (*ngrok.Vault, error) {
arg := &ngrok.Item{ID: id}
@@ -124,7 +124,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.Vault, error) {
// Get Secrets by Vault ID
//
// https://ngrok.com/docs/api#api-vaults-get-secrets-by-vault
// https://ngrok.com/docs/api-reference/vaults/get-secrets-by-vault
func (c *Client) GetSecretsByVault(id string, paging *ngrok.Paging) ngrok.Iter[*ngrok.Secret] {
arg := &ngrok.ItemPaging{ID: id}
if paging == nil {
@@ -226,7 +226,7 @@ func (it *iterGetSecretsByVault) Err() error {
// List all Vaults owned by account
//
// https://ngrok.com/docs/api#api-vaults-list
// https://ngrok.com/docs/api-reference/vaults/list
func (c *Client) List(paging *ngrok.FilteredPaging) ngrok.Iter[*ngrok.Vault] {
if paging == nil {
paging = new(ngrok.FilteredPaging)