From ea905fb4a95b24a723f7e659844b9c04d1c28101 Mon Sep 17 00:00:00 2001 From: Utsa Santhosh Date: Wed, 23 Aug 2023 16:32:59 -0700 Subject: [PATCH] adding related contracts --- go/tunnels/tunnel.go | 32 +++++++++++-------- .../microsoft/tunnels/contracts/Tunnel.java | 7 ++++ rs/src/contracts/tunnel.rs | 4 +++ ts/src/contracts/tunnel.ts | 6 ++++ 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/go/tunnels/tunnel.go b/go/tunnels/tunnel.go index 4b6a0a22..d045ebdd 100644 --- a/go/tunnels/tunnel.go +++ b/go/tunnels/tunnel.go @@ -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. // @@ -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"` } diff --git a/java/src/main/java/com/microsoft/tunnels/contracts/Tunnel.java b/java/src/main/java/com/microsoft/tunnels/contracts/Tunnel.java index 0ba3de50..38c87782 100644 --- a/java/src/main/java/com/microsoft/tunnels/contracts/Tunnel.java +++ b/java/src/main/java/com/microsoft/tunnels/contracts/Tunnel.java @@ -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; } diff --git a/rs/src/contracts/tunnel.rs b/rs/src/contracts/tunnel.rs index a5a25904..c4993f85 100644 --- a/rs/src/contracts/tunnel.rs +++ b/rs/src/contracts/tunnel.rs @@ -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>, + + // Gets or the custom amount of time the tunnel will be valid if it is not used or + // updated. + pub custom_expiration: Option, } diff --git a/ts/src/contracts/tunnel.ts b/ts/src/contracts/tunnel.ts index f723bd31..41092631 100644 --- a/ts/src/contracts/tunnel.ts +++ b/ts/src/contracts/tunnel.ts @@ -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; }