Skip to content

Commit

Permalink
Allow endpoint id to be nullable (#319)
Browse files Browse the repository at this point in the history
* update endpoint id type

* go version
  • Loading branch information
jfullerton44 authored Sep 25, 2023
1 parent c85e067 commit 87d5ddd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion cs/src/Contracts/TunnelEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public abstract class TunnelEndpoint
/// <summary>
/// Gets or sets the ID of this endpoint.
/// </summary>
public string Id { get; set; } = null!;
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Id { get; set; }

/// <summary>
/// Gets or sets the connection mode of the endpoint.
Expand Down
2 changes: 1 addition & 1 deletion go/tunnels/tunnel_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package tunnels
// environment or client capabilities.
type TunnelEndpoint struct {
// Gets or sets the ID of this endpoint.
ID string `json:"id"`
ID string `json:"id,omitempty"`

// Gets or sets the connection mode of the endpoint.
//
Expand Down
14 changes: 7 additions & 7 deletions go/tunnels/tunnels.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import (
"github.com/rodaine/table"
)

const PackageVersion = "0.0.22"
const PackageVersion = "0.0.23"

func (tunnel *Tunnel) requestObject() (*Tunnel, error) {
convertedTunnel := &Tunnel{
Name: tunnel.Name,
Domain: tunnel.Domain,
Description: tunnel.Description,
Tags: tunnel.Tags,
Options: tunnel.Options,
Endpoints: tunnel.Endpoints,
Name: tunnel.Name,
Domain: tunnel.Domain,
Description: tunnel.Description,
Tags: tunnel.Tags,
Options: tunnel.Options,
Endpoints: tunnel.Endpoints,
CustomExpiration: tunnel.CustomExpiration,
}
if tunnel.AccessControl != nil {
Expand Down
2 changes: 1 addition & 1 deletion rs/src/contracts/tunnel_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize};
#[serde(rename_all(serialize = "camelCase", deserialize = "camelCase"))]
pub struct TunnelEndpoint {
// Gets or sets the ID of this endpoint.
pub id: String,
pub id: Option<String>,

// Gets or sets the connection mode of the endpoint.
//
Expand Down
2 changes: 1 addition & 1 deletion ts/src/contracts/tunnelEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface TunnelEndpoint {
/**
* Gets or sets the ID of this endpoint.
*/
id: string;
id?: string;

/**
* Gets or sets the connection mode of the endpoint.
Expand Down

0 comments on commit 87d5ddd

Please sign in to comment.