Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/tools/generator/cmd/v2/common/changelogProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func funcOperation(content *delta.Content) {
if funcValue.Returns != nil {
rs := strings.Split(*funcValue.Returns, ",")
clientFuncResponse := rs[0]
if strings.Contains(clientFunc[1], "runtime.Poller") {
if strings.Contains(clientFuncResponse, "runtime") {
re := regexp.MustCompile("\\[(?P<response>.*)\\]")
clientFuncResponse = re.FindString(clientFuncResponse)
clientFuncResponse = re.ReplaceAllString(clientFuncResponse, "${response}")
Expand Down Expand Up @@ -337,7 +337,7 @@ func LROFilter(changelog *model.Changelog) {
clientFunc := strings.Split(bFunc, ".")
if len(clientFunc) == 2 {
if strings.Contains(clientFunc[1], "Begin") {
clientFunc[1] = strings.ReplaceAll(clientFunc[1], "Being", "")
clientFunc[1] = strings.TrimPrefix(clientFunc[1], "Begin")
beginFunc = fmt.Sprintf("%s.%s", clientFunc[0], clientFunc[1])
} else {
beginFunc = fmt.Sprintf("%s.Begin%s", clientFunc[0], clientFunc[1])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestFuncFilter(t *testing.T) {

common.FilterChangelog(changelog, common.FuncFilter)

excepted := fmt.Sprint("### Breaking Changes\n\n- Function `*Client.Update` has been removed\n\n### Features Added\n\n- New function `*Client.BeginCreateOrUpdate(string, *ClientBeginCreateOrUpdateOptions) (ClientBeginCreateOrUpdateResponse, error)`\n")
excepted := fmt.Sprint("### Breaking Changes\n\n- Function `*Client.BeingDelete` has been removed\n- Function `*Client.NewListPager` has been removed\n- Function `*Client.Update` has been removed\n\n### Features Added\n\n- New function `*Client.BeginCreateOrUpdate(string, *ClientBeginCreateOrUpdateOptions) (ClientBeginCreateOrUpdateResponse, error)`\n- New function `*Client.NewListBySubscriptionPager(*ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse]`\n")
assert.Equal(t, excepted, changelog.ToCompactMarkdown())
}

Expand All @@ -75,7 +75,7 @@ func TestLROFilter(t *testing.T) {

common.FilterChangelog(changelog, common.FuncFilter, common.LROFilter)

excepted := fmt.Sprint("### Breaking Changes\n\n- Operation `*Client.CreateOrUpdate` has been changed to LRO, use `*Client.BeginCreateOrUpdate` instead.\n")
excepted := fmt.Sprint("### Breaking Changes\n\n- Operation `*Client.BeginDelete` has been changed to non-LRO, use `*Client.Delete` instead.\n- Operation `*Client.CreateOrUpdate` has been changed to LRO, use `*Client.BeginCreateOrUpdate` instead.\n")
assert.Equal(t, excepted, changelog.ToCompactMarkdown())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ func (client *Client) BeginCreateOrUpdate(resourceGroupName string, options *Cli
type ClientBeginCreateOrUpdateOptions struct{}

type ClientBeginCreateOrUpdateResponse struct{}

func (client *Client) Delete(resourceGroupName string, options *ClientDeleteOptions) (ClientDeleteResponse, error) {

return ClientDeleteResponse{}, nil
}

type ClientDeleteOptions struct{}

type ClientDeleteResponse struct{}
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ func (client *Client) BeginCreateOrUpdate(resourceGroupName string, options *Cli
type ClientBeginCreateOrUpdateOptions struct{}

type ClientBeginCreateOrUpdateResponse struct{}

func (client *Client) NewListBySubscriptionPager(options *ClientListBySubscriptionOptions) *runtime.Pager[ClientListBySubscriptionResponse] {
return &runtime.Pager[ClientListBySubscriptionResponse]
}

type ClientListBySubscriptionOptions struct{}

type ClientListBySubscriptionResponse struct{}
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ func (client *Client) CreateOrUpdate(resourceGroupName string, options *ClientCr
type ClientCreateOrUpdateOptions struct{}

type ClientCreateOrUpdateResponse struct{}

func (client *Client) BeginDelete(resourceGroupName string, options *ClientBeginDeleteOptions) (ClientBeginDeleteResponse, error) {

return ClientBeginDeleteResponse{}, nil
}

type ClientBeginDeleteOptions struct{}

type ClientBeginDeleteResponse struct{}
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,20 @@ func (client *Client) Update(resourceGroupName string, options *ClientUpdateOpti
type ClientUpdateOptions struct{}

type ClientUpdateResponse struct{}

func (client *Client) BeingDelete(resourceGroupName string, options *ClientBeginDeleteOptions) (*runtime.Poller[ClientBeginDeleteResponse], error) {

return &runtime.Poller[ClientBeginDeleteResponse]{}, nil
}

type ClientBeginDeleteOptions struct{}

type ClientBeginDeleteResponse struct{}

func (client *Client) NewListPager(resourceGroupName string, options *ClientListOptions) *runtime.Pager[ClientListResponse] {
return &runtime.Pager[ClientListResponse]
}

type ClientListOptions struct{}

type ClientListResponse struct{}