Skip to content

Commit

Permalink
adding related contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
Utsa Santhosh committed Aug 23, 2023
1 parent 412910e commit ea905fb
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 14 deletions.
32 changes: 18 additions & 14 deletions go/tunnels/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,44 @@ import (
// Data contract for tunnel objects managed through the tunnel service REST API.
type Tunnel struct {
// Gets or sets the ID of the cluster the tunnel was created in.
ClusterID string `json:"clusterId,omitempty"`
ClusterID string `json:"clusterId,omitempty"`

// Gets or sets the generated ID of the tunnel, unique within the cluster.
TunnelID string `json:"tunnelId,omitempty"`
TunnelID string `json:"tunnelId,omitempty"`

// Gets or sets the optional short name (alias) of the tunnel.
//
// The name must be globally unique within the parent domain, and must be a valid
// subdomain.
Name string `json:"name,omitempty"`
Name string `json:"name,omitempty"`

// Gets or sets the description of the tunnel.
Description string `json:"description,omitempty"`
Description string `json:"description,omitempty"`

// Gets or sets the tags of the tunnel.
Tags []string `json:"tags,omitempty"`
Tags []string `json:"tags,omitempty"`

// Gets or sets the optional parent domain of the tunnel, if it is not using the default
// parent domain.
Domain string `json:"domain,omitempty"`
Domain string `json:"domain,omitempty"`

// Gets or sets a dictionary mapping from scopes to tunnel access tokens.
AccessTokens map[TunnelAccessScope]string `json:"accessTokens,omitempty"`
AccessTokens map[TunnelAccessScope]string `json:"accessTokens,omitempty"`

// Gets or sets access control settings for the tunnel.
//
// See `TunnelAccessControl` documentation for details about the access control model.
AccessControl *TunnelAccessControl `json:"accessControl,omitempty"`
AccessControl *TunnelAccessControl `json:"accessControl,omitempty"`

// Gets or sets default options for the tunnel.
Options *TunnelOptions `json:"options,omitempty"`
Options *TunnelOptions `json:"options,omitempty"`

// Gets or sets current connection status of the tunnel.
Status *TunnelStatus `json:"status,omitempty"`
Status *TunnelStatus `json:"status,omitempty"`

// Gets or sets an array of endpoints where hosts are currently accepting client
// connections to the tunnel.
Endpoints []TunnelEndpoint `json:"endpoints,omitempty"`
Endpoints []TunnelEndpoint `json:"endpoints,omitempty"`

// Gets or sets a list of ports in the tunnel.
//
Expand All @@ -57,11 +57,15 @@ type Tunnel struct {
// creating a tunnel. It is omitted when listing (multiple) tunnels, or when updating
// tunnel properties. (For the latter, use APIs to create/update/delete individual ports
// instead.)
Ports []TunnelPort `json:"ports,omitempty"`
Ports []TunnelPort `json:"ports,omitempty"`

// Gets or sets the time in UTC of tunnel creation.
Created *time.Time `json:"created,omitempty"`
Created *time.Time `json:"created,omitempty"`

// Gets or the time the tunnel will be deleted if it is not used or updated.
Expiration *time.Time `json:"expiration,omitempty"`
Expiration *time.Time `json:"expiration,omitempty"`

// Gets or the custom amount of time the tunnel will be valid if it is not used or
// updated.
CustomExpiration uint32 `json:"customExpiration,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,11 @@ public class Tunnel {
*/
@Expose
public Date expiration;

/**
* Gets or the custom amount of time the tunnel will be valid if it is not used or
* updated.
*/
@Expose
public int customExpiration;
}
4 changes: 4 additions & 0 deletions rs/src/contracts/tunnel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,8 @@ pub struct Tunnel {

// Gets or the time the tunnel will be deleted if it is not used or updated.
pub expiration: Option<DateTime<Utc>>,

// Gets or the custom amount of time the tunnel will be valid if it is not used or
// updated.
pub custom_expiration: Option<u32>,
}
6 changes: 6 additions & 0 deletions ts/src/contracts/tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,10 @@ export interface Tunnel {
* Gets or the time the tunnel will be deleted if it is not used or updated.
*/
expiration?: Date;

/**
* Gets or the custom amount of time the tunnel will be valid if it is not used or
* updated.
*/
customExpiration?: number;
}

0 comments on commit ea905fb

Please sign in to comment.