Skip to content

Commit

Permalink
rename version apis
Browse files Browse the repository at this point in the history
  • Loading branch information
nijosmsft committed Oct 4, 2024
1 parent 78f4a1a commit 6ca8fff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions services/network/virtualnetwork/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
// Service interface
type Service interface {
Get(context.Context, string, string) (*[]network.VirtualNetwork, error)
GetEx(context.Context, string, string, string) (*[]network.VirtualNetwork, error)
GetWithVersion(context.Context, string, string, string) (*[]network.VirtualNetwork, error)
CreateOrUpdate(context.Context, string, string, *network.VirtualNetwork) (*network.VirtualNetwork, error)
CreateOrUpdateEx(context.Context, string, string, *network.VirtualNetwork, string) (*network.VirtualNetwork, error)
CreateOrUpdateWithVersion(context.Context, string, string, *network.VirtualNetwork, string) (*network.VirtualNetwork, error)
Delete(context.Context, string, string) error
DeleteEx(context.Context, string, string, string) error
DeleteWithVersion(context.Context, string, string, string) error
Precheck(ctx context.Context, group string, virtualNetworks []*network.VirtualNetwork) (bool, error)
}

Expand All @@ -43,8 +43,8 @@ func (c *VirtualNetworkClient) Get(ctx context.Context, group, name string) (*[]
}

// Get methods invokes the client Get method
func (c *VirtualNetworkClient) GetEx(ctx context.Context, group, name, apiVersion string) (*[]network.VirtualNetwork, error) {
return c.internal.GetEx(ctx, group, name, apiVersion)
func (c *VirtualNetworkClient) GetWithVersion(ctx context.Context, group, name, apiVersion string) (*[]network.VirtualNetwork, error) {
return c.internal.GetWithVersion(ctx, group, name, apiVersion)
}

// CreateOrUpdate methods invokes create or update on the client
Expand All @@ -53,8 +53,8 @@ func (c *VirtualNetworkClient) CreateOrUpdate(ctx context.Context, group, name s
}

// CreateOrUpdate methods invokes create or update on the client
func (c *VirtualNetworkClient) CreateOrUpdateEx(ctx context.Context, group, name string, network *network.VirtualNetwork, apiVersion string) (*network.VirtualNetwork, error) {
return c.internal.CreateOrUpdateEx(ctx, group, name, network, apiVersion)
func (c *VirtualNetworkClient) CreateOrUpdateWithVersion(ctx context.Context, group, name string, network *network.VirtualNetwork, apiVersion string) (*network.VirtualNetwork, error) {
return c.internal.CreateOrUpdateWithVersion(ctx, group, name, network, apiVersion)
}

// Delete methods invokes delete of the network resource
Expand All @@ -63,8 +63,8 @@ func (c *VirtualNetworkClient) Delete(ctx context.Context, group, name string) e
}

// Delete methods invokes delete of the network resource
func (c *VirtualNetworkClient) DeleteEx(ctx context.Context, group, name, apiVersion string) error {
return c.internal.DeleteEx(ctx, group, name, apiVersion)
func (c *VirtualNetworkClient) DeleteWithVersion(ctx context.Context, group, name, apiVersion string) error {
return c.internal.DeleteWithVersion(ctx, group, name, apiVersion)
}

// Prechecks whether the system is able to create specified resources.
Expand Down
10 changes: 5 additions & 5 deletions services/network/virtualnetwork/wssd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
const (
// supported API versions for vnet
Version_Default = ""
Version_1_0 = "1.0"
Version_1_0 = "1.0" // same as Version_Default
Version_2_0 = "2.0"
)

Expand All @@ -37,7 +37,7 @@ func newVirtualNetworkClient(subID string, authorizer auth.Authorizer) (*client,
}

// Get
func (c *client) GetEx(ctx context.Context, group, name, apiVersion string) (*[]network.VirtualNetwork, error) {
func (c *client) GetWithVersion(ctx context.Context, group, name, apiVersion string) (*[]network.VirtualNetwork, error) {
request, err := getVirtualNetworkRequest(wssdcloudcommon.Operation_GET, group, name, nil, apiVersion)
if err != nil {
return nil, err
Expand Down Expand Up @@ -82,7 +82,7 @@ func (c *client) CreateOrUpdate(ctx context.Context, group, name string, vnet *n
}

// CreateOrUpdate
func (c *client) CreateOrUpdateEx(ctx context.Context, group, name string, vnet *network.VirtualNetwork, apiVersion string) (*network.VirtualNetwork, error) {
func (c *client) CreateOrUpdateWithVersion(ctx context.Context, group, name string, vnet *network.VirtualNetwork, apiVersion string) (*network.VirtualNetwork, error) {
request, err := getVirtualNetworkRequest(wssdcloudcommon.Operation_POST, group, name, vnet, apiVersion)
if err != nil {
return nil, err
Expand Down Expand Up @@ -120,8 +120,8 @@ func (c *client) Delete(ctx context.Context, group, name string) error {
}

// Delete methods invokes create or update on the client
func (c *client) DeleteEx(ctx context.Context, group, name string, apiVersion string) error {
vnet, err := c.GetEx(ctx, group, name, apiVersion)
func (c *client) DeleteWithVersion(ctx context.Context, group, name string, apiVersion string) error {
vnet, err := c.GetWithVersion(ctx, group, name, apiVersion)
if err != nil {
return err
}
Expand Down

0 comments on commit 6ca8fff

Please sign in to comment.