|
| 1 | +import "@typespec/http"; |
| 2 | +import "@typespec/rest"; |
| 3 | +import "@typespec/openapi"; |
| 4 | +import "@typespec/openapi3"; |
| 5 | +import "../common/error.tsp"; |
| 6 | +import "../common/pagination.tsp"; |
| 7 | +import "../common/parameters.tsp"; |
| 8 | +import "../shared/index.tsp"; |
| 9 | +import "./codes.tsp"; |
| 10 | + |
| 11 | +using TypeSpec.Http; |
| 12 | +using TypeSpec.OpenAPI; |
| 13 | + |
| 14 | +namespace Tax; |
| 15 | + |
| 16 | +interface TaxCodesOperations { |
| 17 | + @post |
| 18 | + @operationId("create-tax-code") |
| 19 | + @summary("Create tax code") |
| 20 | + @extension(Shared.PrivateExtension, true) |
| 21 | + @extension(Shared.UnstableExtension, true) |
| 22 | + create( |
| 23 | + @body |
| 24 | + tax_code: Shared.CreateRequest<TaxCode>, |
| 25 | + ): Shared.CreateResponse<TaxCode> | Common.ErrorResponses; |
| 26 | + |
| 27 | + @get |
| 28 | + @operationId("get-tax-code") |
| 29 | + @summary("Get tax code") |
| 30 | + @extension(Shared.PrivateExtension, true) |
| 31 | + @extension(Shared.UnstableExtension, true) |
| 32 | + get( |
| 33 | + @path taxCodeId: Shared.ULID, |
| 34 | + ): Shared.GetResponse<TaxCode> | Common.NotFound | Common.ErrorResponses; |
| 35 | + |
| 36 | + @get |
| 37 | + @operationId("list-tax-codes") |
| 38 | + @summary("List tax codes") |
| 39 | + @extension(Shared.PrivateExtension, true) |
| 40 | + @extension(Shared.UnstableExtension, true) |
| 41 | + list( |
| 42 | + ...Common.PagePaginationQuery, |
| 43 | + ): Shared.PagePaginatedResponse<TaxCode> | Common.ErrorResponses; |
| 44 | + |
| 45 | + @put |
| 46 | + @operationId("upsert-tax-code") |
| 47 | + @summary("Upsert tax code") |
| 48 | + @extension(Shared.PrivateExtension, true) |
| 49 | + @extension(Shared.UnstableExtension, true) |
| 50 | + upsert( |
| 51 | + @path taxCodeId: Shared.ULID, |
| 52 | + |
| 53 | + @body |
| 54 | + tax_code: Shared.UpsertRequest<TaxCode>, |
| 55 | + ): |
| 56 | + | Shared.UpsertResponse<TaxCode> |
| 57 | + | Common.Gone |
| 58 | + | Common.NotFound |
| 59 | + | Common.ErrorResponses; |
| 60 | + |
| 61 | + @delete |
| 62 | + @operationId("delete-tax-code") |
| 63 | + @summary("Delete tax code") |
| 64 | + @extension(Shared.PrivateExtension, true) |
| 65 | + @extension(Shared.UnstableExtension, true) |
| 66 | + delete( |
| 67 | + @path taxCodeId: Shared.ULID, |
| 68 | + ): Shared.DeleteResponse | Common.NotFound | Common.ErrorResponses; |
| 69 | +} |
0 commit comments