Skip to content

Commit 84b068b

Browse files
committed
add demo endpoints
1 parent 8510d26 commit 84b068b

File tree

4 files changed

+218
-0
lines changed

4 files changed

+218
-0
lines changed

model/equaliq.smithy

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ service EqualIQ {
1212
operations: [
1313
GetContract
1414
ListContracts
15+
GetDemoContract
16+
ListDemoContracts
1517
GetUploadURL
1618
UpdateContract
1719
DeleteContract
@@ -190,6 +192,70 @@ structure ListContractsOutput {
190192
shared: ContractSummaryList
191193
}
192194

195+
@http(method: "POST", uri: "/getDemoContract")
196+
operation GetDemoContract {
197+
input: GetDemoContractInput
198+
output: GetDemoContractOutput
199+
errors: [
200+
AuthenticationError
201+
ResourceNotFoundError
202+
InternalServerError
203+
]
204+
}
205+
206+
structure GetDemoContractInput {
207+
@required
208+
contractId: ContractId
209+
}
210+
211+
structure GetDemoContractOutput {
212+
@required
213+
contractId: ContractId
214+
215+
@required
216+
name: String
217+
218+
@required
219+
type: ContractType
220+
221+
@required
222+
terms: TermsList
223+
224+
@required
225+
qa_sections: String
226+
227+
@required
228+
isOwner: Boolean
229+
230+
@required
231+
ownerId: UserId
232+
233+
@required
234+
sharedWith: UserIdList
235+
}
236+
237+
@http(method: "POST", uri: "/listDemoContracts")
238+
operation ListDemoContracts {
239+
input: ListDemoContractsInput
240+
output: ListDemoContractsOutput
241+
errors: [
242+
AuthenticationError
243+
InternalServerError
244+
]
245+
}
246+
247+
structure ListDemoContractsInput {
248+
// Empty input - authentication handled via Bearer token
249+
}
250+
251+
structure ListDemoContractsOutput {
252+
@required
253+
owned: ContractSummaryList
254+
255+
@required
256+
shared: ContractSummaryList
257+
}
258+
193259
list ContractSummaryList {
194260
member: ContractSummaryItem
195261
}

python/api_model/types/models.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ class GetContractSignaturesRequestContent(BaseModel):
8787
contractId: str
8888

8989

90+
class GetDemoContractRequestContent(BaseModel):
91+
contractId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
92+
93+
9094
class GetProfilePictureRequestContent(BaseModel):
9195
userId: Optional[str] = Field(None, pattern='^[A-Za-z0-9-]+$')
9296

@@ -276,6 +280,17 @@ class GetContractSignaturesResponseContent(BaseModel):
276280
signatures: Optional[List[ContractSignature]] = None
277281

278282

283+
class GetDemoContractResponseContent(BaseModel):
284+
contractId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
285+
name: str
286+
type: ContractType
287+
terms: List[Term]
288+
qa_sections: str
289+
isOwner: bool
290+
ownerId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
291+
sharedWith: List[SharedWithItem]
292+
293+
279294
class GetProfileResponseContent(BaseModel):
280295
userId: str = Field(..., pattern='^[A-Za-z0-9-]+$')
281296
profile: UserProfile
@@ -290,6 +305,11 @@ class ListContractsResponseContent(BaseModel):
290305
shared: List[ContractSummaryItem]
291306

292307

308+
class ListDemoContractsResponseContent(BaseModel):
309+
owned: List[ContractSummaryItem]
310+
shared: List[ContractSummaryItem]
311+
312+
293313
class ShareContractResponseContent(BaseModel):
294314
success: bool
295315
contractId: str = Field(..., pattern='^[A-Za-z0-9-]+$')

typescript/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export type GetContractRequestContent = ExtractSchema<'GetContractRequestContent
2727
export type GetContractResponseContent = ExtractSchema<'GetContractResponseContent'>
2828
export type GetContractSignaturesRequestContent = ExtractSchema<'GetContractSignaturesRequestContent'>
2929
export type GetContractSignaturesResponseContent = ExtractSchema<'GetContractSignaturesResponseContent'>
30+
export type GetDemoContractRequestContent = ExtractSchema<'GetDemoContractRequestContent'>
31+
export type GetDemoContractResponseContent = ExtractSchema<'GetDemoContractResponseContent'>
3032
export type GetProfilePictureRequestContent = ExtractSchema<'GetProfilePictureRequestContent'>
3133
export type GetProfilePictureResponseContent = ExtractSchema<'GetProfilePictureResponseContent'>
3234
export type GetProfileRequestContent = ExtractSchema<'GetProfileRequestContent'>
@@ -37,6 +39,7 @@ export type GetUploadURLRequestContent = ExtractSchema<'GetUploadURLRequestConte
3739
export type GetUploadURLResponseContent = ExtractSchema<'GetUploadURLResponseContent'>
3840
export type InternalServerErrorResponseContent = ExtractSchema<'InternalServerErrorResponseContent'>
3941
export type ListContractsResponseContent = ExtractSchema<'ListContractsResponseContent'>
42+
export type ListDemoContractsResponseContent = ExtractSchema<'ListDemoContractsResponseContent'>
4043
export type PingResponseContent = ExtractSchema<'PingResponseContent'>
4144
export type PresignedPostData = ExtractSchema<'PresignedPostData'>
4245
export type ProcessingIncompleteErrorResponseContent = ExtractSchema<'ProcessingIncompleteErrorResponseContent'>

typescript/src/models.ts

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,22 @@ export interface paths {
8484
patch?: never;
8585
trace?: never;
8686
};
87+
"/getDemoContract": {
88+
parameters: {
89+
query?: never;
90+
header?: never;
91+
path?: never;
92+
cookie?: never;
93+
};
94+
get?: never;
95+
put?: never;
96+
post: operations["GetDemoContract"];
97+
delete?: never;
98+
options?: never;
99+
head?: never;
100+
patch?: never;
101+
trace?: never;
102+
};
87103
"/getProfile": {
88104
parameters: {
89105
query?: never;
@@ -148,6 +164,22 @@ export interface paths {
148164
patch?: never;
149165
trace?: never;
150166
};
167+
"/listDemoContracts": {
168+
parameters: {
169+
query?: never;
170+
header?: never;
171+
path?: never;
172+
cookie?: never;
173+
};
174+
get?: never;
175+
put?: never;
176+
post: operations["ListDemoContracts"];
177+
delete?: never;
178+
options?: never;
179+
head?: never;
180+
patch?: never;
181+
trace?: never;
182+
};
151183
"/notARealEndpoint": {
152184
parameters: {
153185
query?: never;
@@ -378,6 +410,19 @@ export interface components {
378410
contractId?: string;
379411
signatures?: components["schemas"]["ContractSignature"][];
380412
};
413+
GetDemoContractRequestContent: {
414+
contractId: string;
415+
};
416+
GetDemoContractResponseContent: {
417+
contractId: string;
418+
name: string;
419+
type: components["schemas"]["ContractType"];
420+
terms: components["schemas"]["Term"][];
421+
qa_sections: string;
422+
isOwner: boolean;
423+
ownerId: string;
424+
sharedWith: string[];
425+
};
381426
GetProfilePictureRequestContent: {
382427
userId?: string;
383428
};
@@ -410,6 +455,10 @@ export interface components {
410455
owned: components["schemas"]["ContractSummaryItem"][];
411456
shared: components["schemas"]["ContractSummaryItem"][];
412457
};
458+
ListDemoContractsResponseContent: {
459+
owned: components["schemas"]["ContractSummaryItem"][];
460+
shared: components["schemas"]["ContractSummaryItem"][];
461+
};
413462
PingResponseContent: {
414463
message: string;
415464
};
@@ -737,6 +786,48 @@ export interface operations {
737786
};
738787
};
739788
};
789+
GetDemoContract: {
790+
parameters: {
791+
query?: never;
792+
header?: never;
793+
path?: never;
794+
cookie?: never;
795+
};
796+
requestBody: {
797+
content: {
798+
"application/json": components["schemas"]["GetDemoContractRequestContent"];
799+
};
800+
};
801+
responses: {
802+
/** @description GetDemoContract 200 response */
803+
200: {
804+
headers: {
805+
[name: string]: unknown;
806+
};
807+
content: {
808+
"application/json": components["schemas"]["GetDemoContractResponseContent"];
809+
};
810+
};
811+
/** @description ResourceNotFoundError 400 response */
812+
400: {
813+
headers: {
814+
[name: string]: unknown;
815+
};
816+
content: {
817+
"application/json": components["schemas"]["ResourceNotFoundErrorResponseContent"];
818+
};
819+
};
820+
/** @description InternalServerError 500 response */
821+
500: {
822+
headers: {
823+
[name: string]: unknown;
824+
};
825+
content: {
826+
"application/json": components["schemas"]["InternalServerErrorResponseContent"];
827+
};
828+
};
829+
};
830+
};
740831
GetProfile: {
741832
parameters: {
742833
query?: never;
@@ -901,6 +992,44 @@ export interface operations {
901992
};
902993
};
903994
};
995+
ListDemoContracts: {
996+
parameters: {
997+
query?: never;
998+
header?: never;
999+
path?: never;
1000+
cookie?: never;
1001+
};
1002+
requestBody?: never;
1003+
responses: {
1004+
/** @description ListDemoContracts 200 response */
1005+
200: {
1006+
headers: {
1007+
[name: string]: unknown;
1008+
};
1009+
content: {
1010+
"application/json": components["schemas"]["ListDemoContractsResponseContent"];
1011+
};
1012+
};
1013+
/** @description AuthenticationError 400 response */
1014+
400: {
1015+
headers: {
1016+
[name: string]: unknown;
1017+
};
1018+
content: {
1019+
"application/json": components["schemas"]["AuthenticationErrorResponseContent"];
1020+
};
1021+
};
1022+
/** @description InternalServerError 500 response */
1023+
500: {
1024+
headers: {
1025+
[name: string]: unknown;
1026+
};
1027+
content: {
1028+
"application/json": components["schemas"]["InternalServerErrorResponseContent"];
1029+
};
1030+
};
1031+
};
1032+
};
9041033
ExposeTypes: {
9051034
parameters: {
9061035
query?: never;

0 commit comments

Comments
 (0)