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

Sync stack, codegen support #3010

Open
XiaofeiCao opened this issue Jan 14, 2025 · 0 comments
Open

Sync stack, codegen support #3010

XiaofeiCao opened this issue Jan 14, 2025 · 0 comments
Assignees

Comments

@XiaofeiCao
Copy link
Contributor

XiaofeiCao commented Jan 14, 2025

1. Switch LRO simple sync with response's response body type from model to BinaryData(proxy method as well)

private Response<BinaryData> createWithResponse(String resourceGroupName, String accountName,
        String liveEventName, LiveEventInner parameters, Boolean autoStart, Context context)

This method is for getting activation response of LRO, for SyncAcceptedImpl.

2. LRO methods implementation change

// beginXX(with and without `Context`)
public SyncPoller<PollResult<LiveEventInner>, LiveEventInner> beginCreate(String resourceGroupName,
    String accountName, String liveEventName, LiveEventInner parameters) {
    Response<BinaryData> response = createWithResponse(resourceGroupName, accountName, liveEventName, parameters);
    // needs new `createSync` method(or `create` overload) in `PollerFactory`, or `SyncPollerFactory`
    return PollerFactory.createSync(response, this.client.getHttpPipeline(), LiveEventInner.class,
                LiveEventInner.class, this.client.getContext());
}

// normal XX(with and without `Context`)
public LiveEventInner create(String resourceGroupName, String accountName, String liveEventName,
    LiveEventInner parameters) {
    return beginCreate(resourceGroupName, accountName, liveEventName, parameters).getFinalResult();
}
@XiaofeiCao XiaofeiCao self-assigned this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant