Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tunnel Virtual Network params: #920

Merged
merged 2 commits into from Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions tunnel_virtual_networks.go
Expand Up @@ -35,15 +35,15 @@ type TunnelVirtualNetworksListParams struct {

type TunnelVirtualNetworkCreateParams struct {
AccountID string `json:"-"`
VnetName string `json:"vnet_name"`
Name string `json:"name"`
Comment string `json:"comment,omitempty"`
IsDefault *bool `json:"is_default,omitempty"`
IsDefault bool `json:"is_default"`
}

type TunnelVirtualNetworkUpdateParams struct {
AccountID string `json:"-"`
VnetID string `json:"-"`
VnetName string `json:"vnet_name,omitempty"`
Name string `json:"name,omitempty"`
Comment string `json:"comment,omitempty"`
IsDefaultNetwork *bool `json:"is_default_network,omitempty"`
}
Expand Down Expand Up @@ -97,7 +97,7 @@ func (api *API) CreateTunnelVirtualNetwork(ctx context.Context, params TunnelVir
return TunnelVirtualNetwork{}, ErrMissingAccountID
}

if params.VnetName == "" {
if params.Name == "" {
return TunnelVirtualNetwork{}, ErrMissingVnetName
}

Expand Down
6 changes: 3 additions & 3 deletions tunnel_virtual_networks_test.go
Expand Up @@ -94,8 +94,8 @@ func TestCreateTunnelVirtualNetwork(t *testing.T) {

tunnel, err := client.CreateTunnelVirtualNetwork(context.Background(), TunnelVirtualNetworkCreateParams{
AccountID: testAccountID,
VnetName: "us-east-1-vpc",
IsDefault: BoolPtr(true),
Name: "us-east-1-vpc",
IsDefault: true,
Comment: "Staging VPC for data science",
})

Expand Down Expand Up @@ -147,7 +147,7 @@ func TestUpdateTunnelVirtualNetwork(t *testing.T) {
tunnel, err := client.UpdateTunnelVirtualNetwork(context.Background(), TunnelVirtualNetworkUpdateParams{
AccountID: testAccountID,
VnetID: "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
VnetName: "us-east-1-vpc",
Name: "us-east-1-vpc",
IsDefaultNetwork: BoolPtr(true),
Comment: "Staging VPC for data science",
})
Expand Down