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

Respect client level parameter in api client factory function #2809

Open
qiaozha opened this issue Sep 10, 2024 · 0 comments
Open

Respect client level parameter in api client factory function #2809

qiaozha opened this issue Sep 10, 2024 · 0 comments
Assignees
Labels
HRLC Mgmt This issue is related to a management-plane library. P1 priority 1

Comments

@qiaozha
Copy link
Member

qiaozha commented Sep 10, 2024

Currently, if we have client level lifted parameter, our interface would be like
Modular client constructor

export class NetworkAnalyticsClient {
  constructor(
    credential: TokenCredential,
    subscriptionId: string, // // subscriptionId will be used in buildOperationGroups or buildOperation.
    options: NetworkAnalyticsClientOptionalParams = {},
  ) {}
}

API layer client factory functions

export function createNetworkAnalytics(
  credential: TokenCredential,
  options: NetworkAnalyticsClientOptionalParams = {},
): NetworkAnalyticsContext;

In api layer, we didn't provide it as part of the client factory signature, this is inconsistent between the modular client layer and api layer, which makes sense before, because we were just importing NetworkAnalyticsContext from the rest api, and this doesn't make sense to RLC layer, but since we have decoupled the rlc library from Modular and generating our own context in modular, the consistency between modular client layer and api layer is something we could consider.

export interface NetworkAnalyticsContext extends Client {
  subscriptionId: string;
}
export function createNetworkAnalytics(
  credential: TokenCredential,
  subscriptionId: string,
  options: NetworkAnalyticsClientOptionalParams = {},
): NetworkAnalyticsContext;
@MaryGao MaryGao added Mgmt This issue is related to a management-plane library. HRLC P1 priority 1 labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HRLC Mgmt This issue is related to a management-plane library. P1 priority 1
Projects
None yet
Development

No branches or pull requests

2 participants