|
| 1 | +// Copyright (c) Microsoft Corporation. |
| 2 | +// Licensed under the MIT license. |
| 3 | + |
| 4 | +import { |
| 5 | + ListSchemaGroupsParameters, |
| 6 | + ListSchemaVersionsParameters, |
| 7 | + GetSchemaByIdParameters, |
| 8 | + GetSchemaByVersionParameters, |
| 9 | + GetSchemaPropertiesByContentParameters, |
| 10 | + RegisterSchemaParameters, |
| 11 | +} from "./parameters.js"; |
| 12 | +import { |
| 13 | + ListSchemaGroups200Response, |
| 14 | + ListSchemaGroupsDefaultResponse, |
| 15 | + ListSchemaVersions200Response, |
| 16 | + ListSchemaVersionsDefaultResponse, |
| 17 | + GetSchemaById200Response, |
| 18 | + GetSchemaByIdDefaultResponse, |
| 19 | + GetSchemaByVersion200Response, |
| 20 | + GetSchemaByVersionDefaultResponse, |
| 21 | + GetSchemaPropertiesByContent204Response, |
| 22 | + GetSchemaPropertiesByContentDefaultResponse, |
| 23 | + RegisterSchema204Response, |
| 24 | + RegisterSchemaDefaultResponse, |
| 25 | +} from "./responses.js"; |
| 26 | +import { Client, StreamableMethod } from "@azure-rest/core-client"; |
| 27 | + |
| 28 | +export interface ListSchemaGroups { |
| 29 | + /** Gets the list of schema groups user is authorized to access. */ |
| 30 | + get( |
| 31 | + options?: ListSchemaGroupsParameters, |
| 32 | + ): StreamableMethod< |
| 33 | + ListSchemaGroups200Response | ListSchemaGroupsDefaultResponse |
| 34 | + >; |
| 35 | +} |
| 36 | + |
| 37 | +export interface ListSchemaVersions { |
| 38 | + /** Gets the list of all versions of one schema. */ |
| 39 | + get( |
| 40 | + options?: ListSchemaVersionsParameters, |
| 41 | + ): StreamableMethod< |
| 42 | + ListSchemaVersions200Response | ListSchemaVersionsDefaultResponse |
| 43 | + >; |
| 44 | +} |
| 45 | + |
| 46 | +export interface GetSchemaById { |
| 47 | + /** Gets a registered schema by its unique ID. Azure Schema Registry guarantees that ID is unique within a namespace. Operation response type is based on serialization of schema requested. */ |
| 48 | + get( |
| 49 | + options?: GetSchemaByIdParameters, |
| 50 | + ): StreamableMethod<GetSchemaById200Response | GetSchemaByIdDefaultResponse>; |
| 51 | +} |
| 52 | + |
| 53 | +export interface GetSchemaByVersion { |
| 54 | + /** Gets one specific version of one schema. */ |
| 55 | + get( |
| 56 | + options?: GetSchemaByVersionParameters, |
| 57 | + ): StreamableMethod< |
| 58 | + GetSchemaByVersion200Response | GetSchemaByVersionDefaultResponse |
| 59 | + >; |
| 60 | +} |
| 61 | + |
| 62 | +export interface GetSchemaPropertiesByContent { |
| 63 | + /** Gets the properties referencing an existing schema within the specified schema group, as matched by schema content comparison. */ |
| 64 | + post( |
| 65 | + options: GetSchemaPropertiesByContentParameters, |
| 66 | + ): StreamableMethod< |
| 67 | + | GetSchemaPropertiesByContent204Response |
| 68 | + | GetSchemaPropertiesByContentDefaultResponse |
| 69 | + >; |
| 70 | +} |
| 71 | + |
| 72 | +export interface RegisterSchema { |
| 73 | + /** Register new schema. If schema of specified name does not exist in specified group, schema is created at version 1. If schema of specified name exists already in specified group, schema is created at latest version + 1. */ |
| 74 | + put( |
| 75 | + options: RegisterSchemaParameters, |
| 76 | + ): StreamableMethod< |
| 77 | + RegisterSchema204Response | RegisterSchemaDefaultResponse |
| 78 | + >; |
| 79 | +} |
| 80 | + |
| 81 | +export interface Routes { |
| 82 | + /** Resource for '/$schemaGroups' has methods for the following verbs: get */ |
| 83 | + (path: "/$schemaGroups"): ListSchemaGroups; |
| 84 | + /** Resource for '/$schemaGroups/\{groupName\}/schemas/\{schemaName\}/versions' has methods for the following verbs: get */ |
| 85 | + ( |
| 86 | + path: "/$schemaGroups/{groupName}/schemas/{schemaName}/versions", |
| 87 | + groupName: string, |
| 88 | + schemaName: string, |
| 89 | + ): ListSchemaVersions; |
| 90 | + /** Resource for '/$schemaGroups/$schemas/\{id\}' has methods for the following verbs: get */ |
| 91 | + (path: "/$schemaGroups/$schemas/{id}", id: string): GetSchemaById; |
| 92 | + /** Resource for '/$schemaGroups/\{groupName\}/schemas/\{schemaName\}/versions/\{schemaVersion\}' has methods for the following verbs: get */ |
| 93 | + ( |
| 94 | + path: "/$schemaGroups/{groupName}/schemas/{schemaName}/versions/{schemaVersion}", |
| 95 | + groupName: string, |
| 96 | + schemaName: string, |
| 97 | + schemaVersion: number, |
| 98 | + ): GetSchemaByVersion; |
| 99 | + /** Resource for '/$schemaGroups/\{groupName\}/schemas/\{schemaName\}:get-id' has methods for the following verbs: post */ |
| 100 | + ( |
| 101 | + path: "/$schemaGroups/{groupName}/schemas/{schemaName}:get-id", |
| 102 | + groupName: string, |
| 103 | + schemaName: string, |
| 104 | + ): GetSchemaPropertiesByContent; |
| 105 | + /** Resource for '/$schemaGroups/\{groupName\}/schemas/\{schemaName\}' has methods for the following verbs: put */ |
| 106 | + ( |
| 107 | + path: "/$schemaGroups/{groupName}/schemas/{schemaName}", |
| 108 | + groupName: string, |
| 109 | + schemaName: string, |
| 110 | + ): RegisterSchema; |
| 111 | +} |
| 112 | + |
| 113 | +export type SchemaRegistryClient = Client & { |
| 114 | + path: Routes; |
| 115 | +}; |
0 commit comments