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

Binder models tcgc #2759

Draft
wants to merge 57 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
10267e1
Generate models from TCGC and use binder
joheredi Aug 15, 2024
1d0e542
generic serializers
joheredi Aug 19, 2024
5522764
fix const and enum value expression
qiaozha Aug 29, 2024
ff42613
merge main and resolve conflicts
qiaozha Aug 29, 2024
fb5cc9f
merge main
qiaozha Sep 2, 2024
136a66b
fix paged result model name
qiaozha Sep 3, 2024
1205b52
Update packages/typespec-ts/src/modular/emit-models.ts
qiaozha Sep 3, 2024
e9446b3
remove old imports and refactor serializer util
qiaozha Sep 3, 2024
efe343b
fix serializer
qiaozha Sep 4, 2024
1f251c3
fix anomalydetector
qiaozha Sep 4, 2024
e8ffadb
fix readonly, enum docs missing, serializeRecord crash issues
qiaozha Sep 5, 2024
6a7e682
Update packages/typespec-ts/src/index.ts
qiaozha Sep 5, 2024
cb143cc
Merge branch 'main' into binder-models-tcgc
qiaozha Sep 5, 2024
be80522
fix extensible enum docs, knownvalue enum
qiaozha Sep 5, 2024
91e4e9e
fix known enum name
qiaozha Sep 5, 2024
c61258e
Merge branch 'main' into binder-models-tcgc
qiaozha Sep 5, 2024
92c5a25
use binder to resolve dependencies and reserve work
qiaozha Sep 5, 2024
5149443
Fix missing TokenCredential imports
joheredi Sep 5, 2024
53e235f
Fix client not found issue
joheredi Sep 5, 2024
a6384c7
fix client factory signature
qiaozha Sep 6, 2024
160aa9f
fix anonymous models and visitSdkPackage type
qiaozha Sep 7, 2024
39703d1
fix missing models and client parameters
qiaozha Sep 7, 2024
f15218b
add deserializer
qiaozha Sep 7, 2024
655e1d0
add serializer for enum and union
qiaozha Sep 7, 2024
bf9946c
do not export deserializer
qiaozha Sep 7, 2024
2da07d2
use operation template
qiaozha Sep 9, 2024
ce9bcd4
use sdkmethod to filter method level lifted parameters
qiaozha Sep 9, 2024
d2d6839
Merge branch 'main' into binder-models-tcgc
qiaozha Sep 10, 2024
207268f
fix endpoint template arguments fetching logic
qiaozha Sep 10, 2024
45cdf02
fix duplicate imports
qiaozha Sep 10, 2024
c203010
fix record serializer missing
qiaozha Sep 10, 2024
b1532c1
fix unused imports
qiaozha Sep 10, 2024
02abce0
update serializer and reserve work
qiaozha Sep 11, 2024
2b30bb3
fix body optional
qiaozha Sep 11, 2024
4d799fc
use tcgc name
qiaozha Sep 11, 2024
849dbae
fix model namespace name
qiaozha Sep 11, 2024
e673ece
smoke-test
qiaozha Sep 11, 2024
7794efc
fix extra quotes
qiaozha Sep 12, 2024
4c43a3a
fix serializer and deserializer missing
qiaozha Sep 12, 2024
2aac9f4
normalize clientOptional params
qiaozha Sep 12, 2024
4629802
add array serializer
qiaozha Sep 12, 2024
0f092a8
add array serializer
qiaozha Sep 12, 2024
1aac384
refactor operation helpers
qiaozha Sep 12, 2024
8a10a46
fix serialize value
qiaozha Sep 12, 2024
14e3118
fix smoke test
qiaozha Sep 13, 2024
aa62957
use binder for streamable and generate empty object as record of any
qiaozha Sep 13, 2024
5132824
fix docs missing
qiaozha Sep 13, 2024
cd3fe73
modular models for multi clients
qiaozha Sep 13, 2024
5fb0ae6
use modular client name as context name
qiaozha Sep 13, 2024
66dd336
move options into api folder
qiaozha Sep 13, 2024
3046174
fix docs missing
qiaozha Sep 13, 2024
9c8d698
fix unit test
qiaozha Sep 14, 2024
04f7ab5
fix some unit test and deserializer missing
qiaozha Sep 15, 2024
7022f13
refactor serializer in operationHelpers
qiaozha Sep 16, 2024
f4afc39
fix some ut and add alias description
qiaozha Sep 18, 2024
d1306cc
fix some ut description
qiaozha Sep 20, 2024
b804c19
fix duplicate union type generation
qiaozha Sep 20, 2024
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
8 changes: 4 additions & 4 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/typespec-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@typespec/http": ">=0.59.0 <1.0.0",
"@typespec/rest": ">=0.59.0 <1.0.0",
"@typespec/versioning": ">=0.59.0 <1.0.0",
"prettier": "^3.1.0"
"prettier": "^3.3.3"
},
"devDependencies": {
"ts-node": "^8.5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ export interface AccountSasToken {
}

// @public
export type ActionType = string;
export type ActionType = "Internal";

// @public
export enum ActionTypeKnownValues {
Internal = "\"Internal\""
}

// @public
export interface ConsumptionEndpointsProperties {
Expand Down Expand Up @@ -56,14 +61,29 @@ export type ContinuablePage<TElement, TPage = TElement[]> = TPage & {
};

// @public
export type ControlState = string;
export type ControlState = "Enabled" | "Disabled";

// @public
export type CreatedByType = string;
export enum ControlStateKnownValues {
Disabled = "\"Disabled\"",
Enabled = "\"Enabled\""
}

// @public
export type CreatedByType = "User" | "Application" | "ManagedIdentity" | "Key";

// @public
export enum CreatedByTypeKnownValues {
Application = "\"Application\"",
Key = "\"Key\"",
ManagedIdentity = "\"ManagedIdentity\"",
User = "\"User\""
}

// @public
export interface DataProduct extends TrackedResource {
identity?: ManagedServiceIdentityV4;
name: string;
properties?: DataProductProperties;
}

Expand Down Expand Up @@ -112,6 +132,7 @@ export interface DataProductsAddUserRoleOptionalParams extends OperationOptions

// @public
export interface DataProductsCatalog extends ProxyResource {
name: string;
properties?: DataProductsCatalogProperties;
}

Expand Down Expand Up @@ -215,7 +236,13 @@ export interface DataProductUpdateProperties {
}

// @public
export type DataProductUserRole = string;
export type DataProductUserRole = "Reader" | "SensitiveReader";

// @public
export enum DataProductUserRoleKnownValues {
Reader = "\"Reader\"",
SensitiveReader = "\"SensitiveReader\""
}

// @public
export interface DataProductVersion {
Expand All @@ -224,6 +251,7 @@ export interface DataProductVersion {

// @public
export interface DataType extends ProxyResource {
name: string;
properties?: DataTypeProperties;
}

Expand Down Expand Up @@ -277,7 +305,13 @@ export interface DataTypesOperations {
}

// @public
export type DataTypeState = string;
export type DataTypeState = "Stopped" | "Running";

// @public
export enum DataTypeStateKnownValues {
Running = "\"Running\"",
Stopped = "\"Stopped\""
}

// @public
export interface DataTypesUpdateOptionalParams extends OperationOptions {
Expand All @@ -298,7 +332,17 @@ export interface DataTypeUpdateProperties {
}

// @public
export type DefaultAction = string;
export type DefaultAction = "Allow" | "Deny";

// @public
export enum DefaultActionKnownValues {
Allow = "\"Allow\"",
Deny = "\"Deny\""
}

// @public (undocumented)
export interface DeleteDataRequest {
qiaozha marked this conversation as resolved.
Show resolved Hide resolved
}

// @public
export interface EncryptionKeyDetails {
Expand All @@ -309,10 +353,14 @@ export interface EncryptionKeyDetails {

// @public
export interface ErrorAdditionalInfo {
readonly info?: Record<string, any>;
readonly info?: {};
qiaozha marked this conversation as resolved.
Show resolved Hide resolved
readonly type?: string;
}

// @public (undocumented)
export interface ErrorAdditionalInfoInfo {
}

// @public
export interface ErrorDetail {
readonly additionalInfo?: ErrorAdditionalInfo[];
Expand All @@ -338,83 +386,32 @@ export interface KeyVaultInfo {
keyVaultUrl: string;
}

// @public
export enum KnownActionType {
Internal = "Internal"
}

// @public
export enum KnownControlState {
Disabled = "Disabled",
Enabled = "Enabled"
}

// @public
export enum KnownCreatedByType {
Application = "Application",
Key = "Key",
ManagedIdentity = "ManagedIdentity",
User = "User"
}

// @public
export enum KnownDataProductUserRole {
Reader = "Reader",
SensitiveReader = "SensitiveReader"
}

// @public
export enum KnownDataTypeState {
Running = "Running",
Stopped = "Stopped"
}

// @public
export enum KnownDefaultAction {
Allow = "Allow",
Deny = "Deny"
}

// @public
export enum KnownManagedServiceIdentityType {
None = "None",
SystemAndUserAssigned = "SystemAssigned, UserAssigned",
SystemAssigned = "SystemAssigned",
UserAssigned = "UserAssigned"
}

// @public
export enum KnownOrigin {
"user,system" = "user,system",
system = "system",
user = "user"
}

// @public
export enum KnownProvisioningState {
Accepted = "Accepted",
Canceled = "Canceled",
Deleting = "Deleting",
Failed = "Failed",
Provisioning = "Provisioning",
Succeeded = "Succeeded",
Updating = "Updating"
}

// @public
export interface ListRoleAssignments {
count: number;
roleAssignmentResponse: RoleAssignmentDetail[];
}

// @public (undocumented)
export interface ListRolesAssignmentsRequest {
}

// @public
export interface ManagedResourceGroupConfiguration {
location: string;
name: string;
}

// @public
export type ManagedServiceIdentityType = string;
export type ManagedServiceIdentityType = "None" | "SystemAssigned" | "UserAssigned" | "SystemAssigned, UserAssigned";
qiaozha marked this conversation as resolved.
Show resolved Hide resolved

// @public
export enum ManagedServiceIdentityTypeKnownValues {
None = "\"None\"",
SystemAndUserAssigned = "\"SystemAssigned, UserAssigned\"",
SystemAssigned = "\"SystemAssigned\"",
UserAssigned = "\"UserAssigned\""
}

// @public
export interface ManagedServiceIdentityV4 {
Expand Down Expand Up @@ -466,7 +463,14 @@ export interface OperationsOperations {
}

// @public
export type Origin = string;
export type Origin = "user" | "system" | "user,system";

// @public
export enum OriginKnownValues {
"user,system" = "\"user,system\"",
system = "\"system\"",
user = "\"user\""
}

// @public
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
Expand All @@ -481,7 +485,18 @@ export interface PageSettings {
}

// @public
export type ProvisioningState = string;
export type ProvisioningState = "Succeeded" | "Failed" | "Canceled" | "Provisioning" | "Updating" | "Deleting" | "Accepted";

// @public
export enum ProvisioningStateKnownValues {
Accepted = "\"Accepted\"",
Canceled = "\"Canceled\"",
Deleting = "\"Deleting\"",
Failed = "\"Failed\"",
Provisioning = "\"Provisioning\"",
Succeeded = "\"Succeeded\"",
Updating = "\"Updating\""
}

// @public
export interface ProxyResource extends Resource {
Expand Down Expand Up @@ -557,6 +572,11 @@ export interface UserAssignedIdentity {
// @public
export type Versions = "2023-11-15";

// @public
export enum VersionsKnownValues {
v2023_11_15 = "\"2023-11-15\""
}

// @public
export interface VirtualNetworkRule {
action?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { NetworkAnalyticsContext as Client } from "../index.js";
import {
PathUncheckedResponse,
StreamableMethod,
createRestError,
operationOptionsToRequestParameters,
qiaozha marked this conversation as resolved.
Show resolved Hide resolved
} from "@azure-rest/core-client";
import { serializeRecord } from "../../helpers/serializerHelpers.js";
import {
DataProduct,
dataProductPropertiesSerializer,
managedServiceIdentityV4Serializer,
dataProductUpdatePropertiesSerializer,
DataProduct,
DataProductUpdate,
dataProductUpdatePropertiesSerializer,
AccountSas,
AccountSasToken,
KeyVaultInfo,
RoleAssignmentCommonProperties,
RoleAssignmentDetail,
ListRoleAssignments,
_DataProductListResult,
_DataTypeListResult,
_DataProductsCatalogListResult,
_OperationListResult,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still need to investigate why this is imported however not being used.

} from "../../models/models.js";
import { NetworkAnalyticsContext as Client } from "../index.js";
import {
StreamableMethod,
operationOptionsToRequestParameters,
PathUncheckedResponse,
createRestError,
} from "@azure-rest/core-client";
import { serializeRecord } from "../../helpers/serializerHelpers.js";
import {
PagedAsyncIterableIterator,
buildPagedAsyncIterator,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import {
DataProductsCatalog,
_DataProductsCatalogListResult,
} from "../../models/models.js";
import { NetworkAnalyticsContext as Client } from "../index.js";
import {
StreamableMethod,
operationOptionsToRequestParameters,
PathUncheckedResponse,
StreamableMethod,
createRestError,
operationOptionsToRequestParameters,
} from "@azure-rest/core-client";
import {
_DataProductListResult,
_DataTypeListResult,
DataProductsCatalog,
_DataProductsCatalogListResult,
_OperationListResult,
} from "../../models/models.js";
import {
PagedAsyncIterableIterator,
buildPagedAsyncIterator,
Expand Down
Loading
Loading