From be773eae84a12820119dc15af1fb866fa5362df5 Mon Sep 17 00:00:00 2001 From: ngrok release bot Date: Tue, 14 Jan 2025 21:24:08 +0000 Subject: [PATCH] Update generated files --- CHANGELOG.md | 12 +++++++++++- agent_ingresses/client.go | 14 +++++++------- api_keys/client.go | 14 +++++++------- application_sessions/client.go | 14 +++++++------- application_users/client.go | 14 +++++++------- backends/failover/client.go | 14 +++++++------- backends/http_response/client.go | 14 +++++++------- backends/static_address/client.go | 14 +++++++------- backends/tunnel_group/client.go | 14 +++++++------- backends/weighted/client.go | 14 +++++++------- bot_users/client.go | 14 +++++++------- certificate_authorities/client.go | 14 +++++++------- credentials/client.go | 14 +++++++------- datatypes.go | 7 ++----- edges/https/client.go | 14 +++++++------- edges/tcp/client.go | 14 +++++++------- edges/tls/client.go | 14 +++++++------- endpoints/client.go | 17 +++++++---------- event_destinations/client.go | 14 +++++++------- event_subscriptions/client.go | 14 +++++++------- ip_policies/client.go | 14 +++++++------- ip_policy_rules/client.go | 14 +++++++------- ip_restrictions/client.go | 14 +++++++------- iter.go | 13 +++++++++++++ reserved_addrs/client.go | 14 +++++++------- reserved_domains/client.go | 14 +++++++------- ssh_certificate_authorities/client.go | 14 +++++++------- ssh_credentials/client.go | 14 +++++++------- ssh_host_certificates/client.go | 14 +++++++------- ssh_user_certificates/client.go | 14 +++++++------- tls_certificates/client.go | 14 +++++++------- tunnel_sessions/client.go | 14 +++++++------- tunnels/client.go | 14 +++++++------- 33 files changed, 236 insertions(+), 219 deletions(-) create mode 100644 iter.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 7154ef8..1de9594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,17 @@ +## v7.1.0 +* Updates to KubernetesOperators and Bindings (currently in private beta). + +## v7.0.0 +### Breaking Changes +* Renamed `upstream_proto` to `upstream_protocol` for `endpoint` resources + +## v6.2.0 +* Added support for KubernetesOperators and Bindings (currently in private beta). ## v6.1.0 * Added support for Cloud Endpoints (currently in private beta). +* Renamed `principal_id` to `principal` for `endpoint` resources ## v6.0.0 ### Breaking Changes @@ -67,5 +77,5 @@ Hostports: []string `json:"hostports,omitempty"` ### Additions -New clients have been generated for `ApplicationSessions` and `ApplicationUsers`. +New clients have been generated for `ApplicationSessions` and `ApplicationUsers`. diff --git a/agent_ingresses/client.go b/agent_ingresses/client.go index 01ba809..46d866e 100644 --- a/agent_ingresses/client.go +++ b/agent_ingresses/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.AgentIngress] { if paging == nil { paging = new(ngrok.Paging) } @@ -110,16 +110,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterAgentIngress{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterAgentIngress struct { client *Client n int items []ngrok.AgentIngress @@ -130,7 +130,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterAgentIngress) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -180,14 +180,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the AgentIngress currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.AgentIngress { +func (it *iterAgentIngress) Item() *ngrok.AgentIngress { 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 *Iter) Err() error { +func (it *iterAgentIngress) Err() error { return it.err } diff --git a/api_keys/client.go b/api_keys/client.go index 728be02..207aeab 100644 --- a/api_keys/client.go +++ b/api_keys/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.APIKey] { if paging == nil { paging = new(ngrok.Paging) } @@ -119,16 +119,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterAPIKey{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterAPIKey struct { client *Client n int items []ngrok.APIKey @@ -139,7 +139,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterAPIKey) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -189,14 +189,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the APIKey currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.APIKey { +func (it *iterAPIKey) Item() *ngrok.APIKey { 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 *Iter) Err() error { +func (it *iterAPIKey) Err() error { return it.err } diff --git a/application_sessions/client.go b/application_sessions/client.go index 0e84685..a60f768 100644 --- a/application_sessions/client.go +++ b/application_sessions/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.ApplicationSession] { if paging == nil { paging = new(ngrok.Paging) } @@ -87,16 +87,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterApplicationSession{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterApplicationSession struct { client *Client n int items []ngrok.ApplicationSession @@ -107,7 +107,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterApplicationSession) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -157,13 +157,13 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the ApplicationSession currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.ApplicationSession { +func (it *iterApplicationSession) Item() *ngrok.ApplicationSession { 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 *Iter) Err() error { +func (it *iterApplicationSession) Err() error { return it.err } diff --git a/application_users/client.go b/application_users/client.go index 895b192..e8ad8f0 100644 --- a/application_users/client.go +++ b/application_users/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.ApplicationUser] { if paging == nil { paging = new(ngrok.Paging) } @@ -87,16 +87,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterApplicationUser{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterApplicationUser struct { client *Client n int items []ngrok.ApplicationUser @@ -107,7 +107,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterApplicationUser) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -157,13 +157,13 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the ApplicationUser currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.ApplicationUser { +func (it *iterApplicationUser) Item() *ngrok.ApplicationUser { 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 *Iter) Err() error { +func (it *iterApplicationUser) Err() error { return it.err } diff --git a/backends/failover/client.go b/backends/failover/client.go index 63839e4..9652917 100644 --- a/backends/failover/client.go +++ b/backends/failover/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.FailoverBackend] { if paging == nil { paging = new(ngrok.Paging) } @@ -117,16 +117,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterFailoverBackend{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterFailoverBackend struct { client *Client n int items []ngrok.FailoverBackend @@ -137,7 +137,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterFailoverBackend) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -187,14 +187,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the FailoverBackend currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.FailoverBackend { +func (it *iterFailoverBackend) Item() *ngrok.FailoverBackend { 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 *Iter) Err() error { +func (it *iterFailoverBackend) Err() error { return it.err } diff --git a/backends/http_response/client.go b/backends/http_response/client.go index 29de365..b39c293 100644 --- a/backends/http_response/client.go +++ b/backends/http_response/client.go @@ -83,7 +83,7 @@ func (c *Client) Get(ctx context.Context, id string) (*ngrok.HTTPResponseBackend return &res, nil } -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.HTTPResponseBackend] { if paging == nil { paging = new(ngrok.Paging) } @@ -100,16 +100,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterHTTPResponseBackend{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterHTTPResponseBackend struct { client *Client n int items []ngrok.HTTPResponseBackend @@ -120,7 +120,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterHTTPResponseBackend) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -170,14 +170,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the HTTPResponseBackend currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.HTTPResponseBackend { +func (it *iterHTTPResponseBackend) Item() *ngrok.HTTPResponseBackend { 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 *Iter) Err() error { +func (it *iterHTTPResponseBackend) Err() error { return it.err } diff --git a/backends/static_address/client.go b/backends/static_address/client.go index 58ef0cc..fb22aec 100644 --- a/backends/static_address/client.go +++ b/backends/static_address/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.StaticBackend] { if paging == nil { paging = new(ngrok.Paging) } @@ -115,16 +115,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterStaticBackend{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterStaticBackend struct { client *Client n int items []ngrok.StaticBackend @@ -135,7 +135,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterStaticBackend) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -185,14 +185,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the StaticBackend currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.StaticBackend { +func (it *iterStaticBackend) Item() *ngrok.StaticBackend { 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 *Iter) Err() error { +func (it *iterStaticBackend) Err() error { return it.err } diff --git a/backends/tunnel_group/client.go b/backends/tunnel_group/client.go index 6008039..97c99df 100644 --- a/backends/tunnel_group/client.go +++ b/backends/tunnel_group/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.TunnelGroupBackend] { if paging == nil { paging = new(ngrok.Paging) } @@ -115,16 +115,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterTunnelGroupBackend{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterTunnelGroupBackend struct { client *Client n int items []ngrok.TunnelGroupBackend @@ -135,7 +135,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterTunnelGroupBackend) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -185,14 +185,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the TunnelGroupBackend currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.TunnelGroupBackend { +func (it *iterTunnelGroupBackend) Item() *ngrok.TunnelGroupBackend { 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 *Iter) Err() error { +func (it *iterTunnelGroupBackend) Err() error { return it.err } diff --git a/backends/weighted/client.go b/backends/weighted/client.go index 5bb557b..e0a9524 100644 --- a/backends/weighted/client.go +++ b/backends/weighted/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.WeightedBackend] { if paging == nil { paging = new(ngrok.Paging) } @@ -117,16 +117,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterWeightedBackend{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterWeightedBackend struct { client *Client n int items []ngrok.WeightedBackend @@ -137,7 +137,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterWeightedBackend) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -187,14 +187,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the WeightedBackend currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.WeightedBackend { +func (it *iterWeightedBackend) Item() *ngrok.WeightedBackend { 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 *Iter) Err() error { +func (it *iterWeightedBackend) Err() error { return it.err } diff --git a/bot_users/client.go b/bot_users/client.go index 86062b4..73e202a 100644 --- a/bot_users/client.go +++ b/bot_users/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.BotUser] { if paging == nil { paging = new(ngrok.Paging) } @@ -112,16 +112,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterBotUser{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterBotUser struct { client *Client n int items []ngrok.BotUser @@ -132,7 +132,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterBotUser) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -182,14 +182,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the BotUser currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.BotUser { +func (it *iterBotUser) Item() *ngrok.BotUser { 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 *Iter) Err() error { +func (it *iterBotUser) Err() error { return it.err } diff --git a/certificate_authorities/client.go b/certificate_authorities/client.go index 3dd87e0..66e87c9 100644 --- a/certificate_authorities/client.go +++ b/certificate_authorities/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.CertificateAuthority] { if paging == nil { paging = new(ngrok.Paging) } @@ -115,16 +115,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterCertificateAuthority{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterCertificateAuthority struct { client *Client n int items []ngrok.CertificateAuthority @@ -135,7 +135,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterCertificateAuthority) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -185,14 +185,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the CertificateAuthority currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.CertificateAuthority { +func (it *iterCertificateAuthority) Item() *ngrok.CertificateAuthority { 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 *Iter) Err() error { +func (it *iterCertificateAuthority) Err() error { return it.err } diff --git a/credentials/client.go b/credentials/client.go index 78cf360..214b8ff 100644 --- a/credentials/client.go +++ b/credentials/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.Credential] { if paging == nil { paging = new(ngrok.Paging) } @@ -120,16 +120,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterCredential{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterCredential struct { client *Client n int items []ngrok.Credential @@ -140,7 +140,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterCredential) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -190,14 +190,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the Credential currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.Credential { +func (it *iterCredential) Item() *ngrok.Credential { 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 *Iter) Err() error { +func (it *iterCredential) Err() error { return it.err } diff --git a/datatypes.go b/datatypes.go index 0ed4ea4..9a6529d 100644 --- a/datatypes.go +++ b/datatypes.go @@ -4023,13 +4023,11 @@ type Endpoint struct { // the local address the tunnel forwards to UpstreamURL string `json:"upstream_url,omitempty"` // the protocol the agent uses to forward with - UpstreamProto string `json:"upstream_proto,omitempty"` + UpstreamProtocol string `json:"upstream_protocol,omitempty"` // the url of the endpoint URL string `json:"url,omitempty"` // The ID of the owner (bot or user) that owns this endpoint Principal *Ref `json:"principal,omitempty"` - // TODO: deprecate me! - PrincipalID *Ref `json:"principal_id,omitempty"` // The traffic policy attached to this endpoint TrafficPolicy string `json:"traffic_policy,omitempty"` // the bindings associated with this endpoint @@ -4069,10 +4067,9 @@ func (x *Endpoint) GoString() string { fmt.Fprintf(tw, "\tTunnel\t%v\n", x.Tunnel) fmt.Fprintf(tw, "\tEdge\t%v\n", x.Edge) fmt.Fprintf(tw, "\tUpstreamURL\t%v\n", x.UpstreamURL) - fmt.Fprintf(tw, "\tUpstreamProto\t%v\n", x.UpstreamProto) + fmt.Fprintf(tw, "\tUpstreamProtocol\t%v\n", x.UpstreamProtocol) fmt.Fprintf(tw, "\tURL\t%v\n", x.URL) fmt.Fprintf(tw, "\tPrincipal\t%v\n", x.Principal) - fmt.Fprintf(tw, "\tPrincipalID\t%v\n", x.PrincipalID) fmt.Fprintf(tw, "\tTrafficPolicy\t%v\n", x.TrafficPolicy) fmt.Fprintf(tw, "\tBindings\t%v\n", x.Bindings) fmt.Fprintf(tw, "\tTunnelSession\t%v\n", x.TunnelSession) diff --git a/edges/https/client.go b/edges/https/client.go index 50137e1..7f1497f 100644 --- a/edges/https/client.go +++ b/edges/https/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.HTTPSEdge] { if paging == nil { paging = new(ngrok.Paging) } @@ -89,16 +89,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterHTTPSEdge{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterHTTPSEdge struct { client *Client n int items []ngrok.HTTPSEdge @@ -109,7 +109,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterHTTPSEdge) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -159,14 +159,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the HTTPSEdge currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.HTTPSEdge { +func (it *iterHTTPSEdge) Item() *ngrok.HTTPSEdge { 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 *Iter) Err() error { +func (it *iterHTTPSEdge) Err() error { return it.err } diff --git a/edges/tcp/client.go b/edges/tcp/client.go index 3dc77ce..ab7d952 100644 --- a/edges/tcp/client.go +++ b/edges/tcp/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.TCPEdge] { if paging == nil { paging = new(ngrok.Paging) } @@ -89,16 +89,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterTCPEdge{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterTCPEdge struct { client *Client n int items []ngrok.TCPEdge @@ -109,7 +109,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterTCPEdge) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -159,14 +159,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the TCPEdge currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.TCPEdge { +func (it *iterTCPEdge) Item() *ngrok.TCPEdge { 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 *Iter) Err() error { +func (it *iterTCPEdge) Err() error { return it.err } diff --git a/edges/tls/client.go b/edges/tls/client.go index 3cb6b0d..55e848d 100644 --- a/edges/tls/client.go +++ b/edges/tls/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.TLSEdge] { if paging == nil { paging = new(ngrok.Paging) } @@ -89,16 +89,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterTLSEdge{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterTLSEdge struct { client *Client n int items []ngrok.TLSEdge @@ -109,7 +109,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterTLSEdge) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -159,14 +159,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the TLSEdge currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.TLSEdge { +func (it *iterTLSEdge) Item() *ngrok.TLSEdge { 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 *Iter) Err() error { +func (it *iterTLSEdge) Err() error { return it.err } diff --git a/endpoints/client.go b/endpoints/client.go index a374190..a54f19d 100644 --- a/endpoints/client.go +++ b/endpoints/client.go @@ -28,9 +28,6 @@ func NewClient(cfg *ngrok.ClientConfig) *Client { // // https://ngrok.com/docs/api#api-endpoints-create func (c *Client) Create(ctx context.Context, arg *ngrok.EndpointCreate) (*ngrok.Endpoint, error) { - if arg == nil { - arg = new(ngrok.EndpointCreate) - } var res ngrok.Endpoint var path bytes.Buffer if err := template.Must(template.New("create_path").Parse("/endpoints")).Execute(&path, arg); err != nil { @@ -52,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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.Endpoint] { if paging == nil { paging = new(ngrok.Paging) } @@ -69,16 +66,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterEndpoint{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterEndpoint struct { client *Client n int items []ngrok.Endpoint @@ -89,7 +86,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterEndpoint) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -139,14 +136,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the Endpoint currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.Endpoint { +func (it *iterEndpoint) Item() *ngrok.Endpoint { 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 *Iter) Err() error { +func (it *iterEndpoint) Err() error { return it.err } diff --git a/event_destinations/client.go b/event_destinations/client.go index 89021a0..eb3ae2b 100644 --- a/event_destinations/client.go +++ b/event_destinations/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.EventDestination] { if paging == nil { paging = new(ngrok.Paging) } @@ -114,16 +114,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterEventDestination{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterEventDestination struct { client *Client n int items []ngrok.EventDestination @@ -134,7 +134,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterEventDestination) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -184,14 +184,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the EventDestination currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.EventDestination { +func (it *iterEventDestination) Item() *ngrok.EventDestination { 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 *Iter) Err() error { +func (it *iterEventDestination) Err() error { return it.err } diff --git a/event_subscriptions/client.go b/event_subscriptions/client.go index 47ddb70..58f02f7 100644 --- a/event_subscriptions/client.go +++ b/event_subscriptions/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.EventSubscription] { if paging == nil { paging = new(ngrok.Paging) } @@ -112,16 +112,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterEventSubscription{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterEventSubscription struct { client *Client n int items []ngrok.EventSubscription @@ -132,7 +132,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterEventSubscription) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -182,14 +182,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the EventSubscription currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.EventSubscription { +func (it *iterEventSubscription) Item() *ngrok.EventSubscription { 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 *Iter) Err() error { +func (it *iterEventSubscription) Err() error { return it.err } diff --git a/ip_policies/client.go b/ip_policies/client.go index e22a6d6..3e45da2 100644 --- a/ip_policies/client.go +++ b/ip_policies/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.IPPolicy] { if paging == nil { paging = new(ngrok.Paging) } @@ -120,16 +120,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterIPPolicy{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterIPPolicy struct { client *Client n int items []ngrok.IPPolicy @@ -140,7 +140,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterIPPolicy) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -190,14 +190,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the IPPolicy currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.IPPolicy { +func (it *iterIPPolicy) Item() *ngrok.IPPolicy { 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 *Iter) Err() error { +func (it *iterIPPolicy) Err() error { return it.err } diff --git a/ip_policy_rules/client.go b/ip_policy_rules/client.go index a8b9aeb..65c052a 100644 --- a/ip_policy_rules/client.go +++ b/ip_policy_rules/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.IPPolicyRule] { if paging == nil { paging = new(ngrok.Paging) } @@ -112,16 +112,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterIPPolicyRule{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterIPPolicyRule struct { client *Client n int items []ngrok.IPPolicyRule @@ -132,7 +132,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterIPPolicyRule) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -182,14 +182,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the IPPolicyRule currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.IPPolicyRule { +func (it *iterIPPolicyRule) Item() *ngrok.IPPolicyRule { 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 *Iter) Err() error { +func (it *iterIPPolicyRule) Err() error { return it.err } diff --git a/ip_restrictions/client.go b/ip_restrictions/client.go index 1adad28..fe47be9 100644 --- a/ip_restrictions/client.go +++ b/ip_restrictions/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.IPRestriction] { if paging == nil { paging = new(ngrok.Paging) } @@ -116,16 +116,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterIPRestriction{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterIPRestriction struct { client *Client n int items []ngrok.IPRestriction @@ -136,7 +136,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterIPRestriction) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -186,14 +186,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the IPRestriction currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.IPRestriction { +func (it *iterIPRestriction) Item() *ngrok.IPRestriction { 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 *Iter) Err() error { +func (it *iterIPRestriction) Err() error { return it.err } diff --git a/iter.go b/iter.go new file mode 100644 index 0000000..134cf6d --- /dev/null +++ b/iter.go @@ -0,0 +1,13 @@ +// Code generated for API Clients. DO NOT EDIT. + +package ngrok + +import ( + "context" +) + +type Iter[T any] interface { + Next(context.Context) bool + Item() T + Err() error +} diff --git a/reserved_addrs/client.go b/reserved_addrs/client.go index 5d8cdba..b0d8a73 100644 --- a/reserved_addrs/client.go +++ b/reserved_addrs/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.ReservedAddr] { if paging == nil { paging = new(ngrok.Paging) } @@ -116,16 +116,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterReservedAddr{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterReservedAddr struct { client *Client n int items []ngrok.ReservedAddr @@ -136,7 +136,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterReservedAddr) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -186,14 +186,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the ReservedAddr currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.ReservedAddr { +func (it *iterReservedAddr) Item() *ngrok.ReservedAddr { 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 *Iter) Err() error { +func (it *iterReservedAddr) Err() error { return it.err } diff --git a/reserved_domains/client.go b/reserved_domains/client.go index 0852318..bc5dc44 100644 --- a/reserved_domains/client.go +++ b/reserved_domains/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.ReservedDomain] { if paging == nil { paging = new(ngrok.Paging) } @@ -117,16 +117,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterReservedDomain{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterReservedDomain struct { client *Client n int items []ngrok.ReservedDomain @@ -137,7 +137,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterReservedDomain) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -187,14 +187,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the ReservedDomain currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.ReservedDomain { +func (it *iterReservedDomain) Item() *ngrok.ReservedDomain { 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 *Iter) Err() error { +func (it *iterReservedDomain) Err() error { return it.err } diff --git a/ssh_certificate_authorities/client.go b/ssh_certificate_authorities/client.go index bff67b8..8c27d4d 100644 --- a/ssh_certificate_authorities/client.go +++ b/ssh_certificate_authorities/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.SSHCertificateAuthority] { if paging == nil { paging = new(ngrok.Paging) } @@ -115,16 +115,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterSSHCertificateAuthority{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterSSHCertificateAuthority struct { client *Client n int items []ngrok.SSHCertificateAuthority @@ -135,7 +135,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterSSHCertificateAuthority) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -185,14 +185,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the SSHCertificateAuthority currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.SSHCertificateAuthority { +func (it *iterSSHCertificateAuthority) Item() *ngrok.SSHCertificateAuthority { 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 *Iter) Err() error { +func (it *iterSSHCertificateAuthority) Err() error { return it.err } diff --git a/ssh_credentials/client.go b/ssh_credentials/client.go index 73be4a3..81cb306 100644 --- a/ssh_credentials/client.go +++ b/ssh_credentials/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.SSHCredential] { if paging == nil { paging = new(ngrok.Paging) } @@ -113,16 +113,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterSSHCredential{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterSSHCredential struct { client *Client n int items []ngrok.SSHCredential @@ -133,7 +133,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterSSHCredential) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -183,14 +183,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the SSHCredential currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.SSHCredential { +func (it *iterSSHCredential) Item() *ngrok.SSHCredential { 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 *Iter) Err() error { +func (it *iterSSHCredential) Err() error { return it.err } diff --git a/ssh_host_certificates/client.go b/ssh_host_certificates/client.go index e850a10..a57a0c6 100644 --- a/ssh_host_certificates/client.go +++ b/ssh_host_certificates/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.SSHHostCertificate] { if paging == nil { paging = new(ngrok.Paging) } @@ -113,16 +113,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterSSHHostCertificate{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterSSHHostCertificate struct { client *Client n int items []ngrok.SSHHostCertificate @@ -133,7 +133,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterSSHHostCertificate) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -183,14 +183,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the SSHHostCertificate currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.SSHHostCertificate { +func (it *iterSSHHostCertificate) Item() *ngrok.SSHHostCertificate { 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 *Iter) Err() error { +func (it *iterSSHHostCertificate) Err() error { return it.err } diff --git a/ssh_user_certificates/client.go b/ssh_user_certificates/client.go index d5b06e6..5cbdae7 100644 --- a/ssh_user_certificates/client.go +++ b/ssh_user_certificates/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.SSHUserCertificate] { if paging == nil { paging = new(ngrok.Paging) } @@ -113,16 +113,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterSSHUserCertificate{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterSSHUserCertificate struct { client *Client n int items []ngrok.SSHUserCertificate @@ -133,7 +133,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterSSHUserCertificate) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -183,14 +183,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the SSHUserCertificate currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.SSHUserCertificate { +func (it *iterSSHUserCertificate) Item() *ngrok.SSHUserCertificate { 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 *Iter) Err() error { +func (it *iterSSHUserCertificate) Err() error { return it.err } diff --git a/tls_certificates/client.go b/tls_certificates/client.go index e375709..8e5176b 100644 --- a/tls_certificates/client.go +++ b/tls_certificates/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.TLSCertificate] { if paging == nil { paging = new(ngrok.Paging) } @@ -115,16 +115,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterTLSCertificate{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterTLSCertificate struct { client *Client n int items []ngrok.TLSCertificate @@ -135,7 +135,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterTLSCertificate) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -185,14 +185,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the TLSCertificate currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.TLSCertificate { +func (it *iterTLSCertificate) Item() *ngrok.TLSCertificate { 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 *Iter) Err() error { +func (it *iterTLSCertificate) Err() error { return it.err } diff --git a/tunnel_sessions/client.go b/tunnel_sessions/client.go index c846259..50e4a27 100644 --- a/tunnel_sessions/client.go +++ b/tunnel_sessions/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.TunnelSession] { if paging == nil { paging = new(ngrok.Paging) } @@ -44,16 +44,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterTunnelSession{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterTunnelSession struct { client *Client n int items []ngrok.TunnelSession @@ -64,7 +64,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterTunnelSession) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -114,14 +114,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the TunnelSession currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.TunnelSession { +func (it *iterTunnelSession) Item() *ngrok.TunnelSession { 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 *Iter) Err() error { +func (it *iterTunnelSession) Err() error { return it.err } diff --git a/tunnels/client.go b/tunnels/client.go index 72eb355..4997571 100644 --- a/tunnels/client.go +++ b/tunnels/client.go @@ -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 -func (c *Client) List(paging *ngrok.Paging) *Iter { +func (c *Client) List(paging *ngrok.Paging) ngrok.Iter[*ngrok.Tunnel] { if paging == nil { paging = new(ngrok.Paging) } @@ -43,16 +43,16 @@ func (c *Client) List(paging *ngrok.Paging) *Iter { queryVals.Set("limit", *paging.Limit) } apiURL.RawQuery = queryVals.Encode() - return &Iter{ + return &iterTunnel{ client: c, n: -1, nextPage: apiURL, } } -// Iter allows the caller to iterate through a list of values while +// iter allows the caller to iterate through a list of values while // automatically fetching new pages worth of values from the API. -type Iter struct { +type iterTunnel struct { client *Client n int items []ngrok.Tunnel @@ -63,7 +63,7 @@ type Iter struct { // 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 *Iter) Next(ctx context.Context) bool { +func (it *iterTunnel) Next(ctx context.Context) bool { // no more if there is an error if it.err != nil { return false @@ -113,14 +113,14 @@ func (it *Iter) Next(ctx context.Context) bool { // Item() returns the Tunnel currently // pointed to by the iterator. -func (it *Iter) Item() *ngrok.Tunnel { +func (it *iterTunnel) Item() *ngrok.Tunnel { 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 *Iter) Err() error { +func (it *iterTunnel) Err() error { return it.err }