Download api/spec/packages/aip/src/common/error.tsp from Leon4gr45/openmeter: direct link, hf CLI and curl.
- Browser
- Download file 10.7 kB
-
https://huggingface.co/spaces/Leon4gr45/openmeter/resolve/main/api/spec/packages/aip/src/common/error.tsp
- Command line
-
hf download hf://spaces/Leon4gr45/openmeter/api/spec/packages/aip/src/common/error.tsp
-
curl -L -o error.tsp https://huggingface.co/spaces/Leon4gr45/openmeter/resolve/main/api/spec/packages/aip/src/common/error.tsp
10.7 kB
| import "@typespec/http"; | |
| import "@typespec/openapi"; | |
| import "@typespec/openapi3"; | |
| using TypeSpec.OpenAPI; | |
| using TypeSpec.Http; | |
| namespace Common; | |
| /** | |
| * Bad Request. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("../../../../common/definitions/errors.yaml#/components/responses/BadRequest") | |
| ("BadRequest") | |
| model BadRequest extends BaseError { | |
| _: 400; | |
| /** | |
| * The list of parameters that failed validation. | |
| */ | |
| invalid_parameters: InvalidParameters; | |
| } | |
| /** | |
| * Unauthorized. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("../../../../common/definitions/errors.yaml#/components/responses/Unauthorized") | |
| ("Unauthorized") | |
| model Unauthorized extends BaseError { | |
| _: 401; | |
| } | |
| /** | |
| * Forbidden. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("../../../../common/definitions/errors.yaml#/components/responses/Forbidden") | |
| ("Forbidden") | |
| model Forbidden extends BaseError { | |
| _: 403; | |
| } | |
| /** | |
| * Not Found. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("../../../../common/definitions/errors.yaml#/components/responses/NotFound") | |
| ("NotFound") | |
| model NotFound extends BaseError { | |
| _: 404; | |
| } | |
| /** | |
| * Conflict. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("../../../../common/definitions/errors.yaml#/components/responses/Conflict") | |
| ("Conflict") | |
| model Conflict extends BaseError { | |
| _: 409; | |
| } | |
| /** | |
| * Gone. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("../../../../common/definitions/errors.yaml#/components/responses/Gone") | |
| ("Gone") | |
| model Gone extends BaseError { | |
| _: 410; | |
| } | |
| /** | |
| * Payload Too Large. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("PayloadTooLarge") | |
| ("../../../../common/definitions/errors.yaml#/components/responses/PayloadTooLarge") | |
| ("PayloadTooLarge") | |
| model PayloadTooLarge extends BaseError { | |
| _: 413; | |
| } | |
| /** | |
| * Unsupported Media Type. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("UnsupportedMediaType") | |
| ("../../../../common/definitions/errors.yaml#/components/responses/UnsupportedMediaType") | |
| ("UnsupportedMediaType") | |
| model UnsupportedMediaType extends BaseError { | |
| _: 415; | |
| } | |
| /** | |
| * Unprocessable Content. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("UnprocessableContent") | |
| ("../../../../common/definitions/errors.yaml#/components/responses/UnprocessableContent") | |
| ("UnprocessableContent") | |
| model UnprocessableContent extends BaseError { | |
| _: 422; | |
| } | |
| /** | |
| * Too Many Requests. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("TooManyRequests") | |
| ("../../../../common/definitions/errors.yaml#/components/responses/TooManyRequests") | |
| ("TooManyRequests") | |
| model TooManyRequests extends BaseError { | |
| _: 429; | |
| } | |
| /** | |
| * Internal Server Error. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("../../../../common/definitions/errors.yaml#/components/responses/Internal") | |
| ("Internal") | |
| model Internal extends BaseError { | |
| _: 500; | |
| } | |
| /** | |
| * Not Implemented. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("NotImplemented") | |
| ("../../../../common/definitions/errors.yaml#/components/responses/NotImplemented") | |
| ("NotImplemented") | |
| model NotImplemented extends BaseError { | |
| _: 501; | |
| } | |
| /** | |
| * Not Available. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/composition-over-inheritance" "inheritance" | |
| ("../../../../common/definitions/errors.yaml#/components/responses/NotAvailable") | |
| ("NotAvailable") | |
| model NotAvailable extends BaseError { | |
| _: 503; | |
| } | |
| alias ErrorResponses = BadRequest | Unauthorized | Forbidden; | |
| /** | |
| * Standard error response. | |
| */ | |
| ("BaseError") | |
| model BaseError { | |
| contentType: "application/problem+json"; | |
| /** | |
| * Type contains a URI that identifies the problem type. | |
| */ | |
| ("about:blank") | |
| (Lifecycle.Read) | |
| type: string = "about:blank"; | |
| /** | |
| * The HTTP status code generated by the origin server for this occurrence of the | |
| * problem. | |
| */ | |
| (400) | |
| (Lifecycle.Read) | |
| status: integer; | |
| /** | |
| * A a short, human-readable summary of the problem type. | |
| */ | |
| ("Bad Request") | |
| (Lifecycle.Read) | |
| title: string; | |
| /** | |
| * A human-readable explanation specific to this occurrence of the problem. | |
| */ | |
| ("The request body must be a JSON object.") | |
| detail: string; | |
| /** | |
| * A URI reference that identifies the specific occurrence of the problem. | |
| */ | |
| (Lifecycle.Read) | |
| instance: string; | |
| /** | |
| * Additional properties specific to the problem type may be present. | |
| */ | |
| ...Record<unknown>; | |
| } | |
| /** | |
| * The list of parameters that failed validation. | |
| */ | |
| ("InvalidParameters") | |
| (1) | |
| model InvalidParameters is InvalidParameter[]; | |
| /** | |
| * A parameter that failed validation. | |
| */ | |
| ("InvalidParameter") | |
| union InvalidParameter { | |
| standard: InvalidParameterStandard, | |
| minimumLength: InvalidParameterMinimumLength, | |
| maximumLength: InvalidParameterMaximumLength, | |
| choice: InvalidParameterChoiceItem, | |
| dependent: InvalidParameterDependentItem, | |
| } | |
| /** | |
| * The validation rule that a parameter failed. | |
| */ | |
| ("InvalidRules") | |
| enum InvalidRules { | |
| Required: "required", | |
| IsArray: "is_array", | |
| IsBase64: "is_base64", | |
| IsBoolean: "is_boolean", | |
| IsDateTime: "is_date_time", | |
| IsInteger: "is_integer", | |
| IsNull: "is_null", | |
| IsNumber: "is_number", | |
| IsObject: "is_object", | |
| IsString: "is_string", | |
| IsUuid: "is_uuid", | |
| IsFqdn: "is_fqdn", | |
| IsArn: "is_arn", | |
| UnknownProperty: "unknown_property", | |
| MissingReference: "missing_reference", | |
| IsLabel: "is_label", | |
| MatchesRegex: "matches_regex", | |
| Invalid: "invalid", | |
| IsSupportedNetworkAvailabilityZoneList: "is_supported_network_availability_zone_list", | |
| IsSupportedNetworkCidrBlock: "is_supported_network_cidr_block", | |
| IsSupportedProviderRegion: "is_supported_provider_region", | |
| Type: "type", | |
| } | |
| /** | |
| * A parameter that failed a standard validation rule. | |
| */ | |
| ("InvalidParameterStandard") | |
| model InvalidParameterStandard { | |
| /** | |
| * The name of the field that failed validation. | |
| */ | |
| (Lifecycle.Read) | |
| field: string; | |
| /** | |
| * The validation rule that was violated. | |
| */ | |
| rule?: InvalidRules; | |
| /** | |
| * The part of the request the field came from (e.g. `body`, `query`). | |
| */ | |
| source?: string; | |
| /** | |
| * A human readable explanation of why the field failed validation. | |
| */ | |
| reason: string; | |
| } | |
| /** | |
| * A parameter that failed a minimum-length (or minimum-value) validation rule. | |
| */ | |
| ("InvalidParameterMinimumLength") | |
| model InvalidParameterMinimumLength { | |
| /** | |
| * The name of the field that failed validation. | |
| */ | |
| field: string; | |
| /** | |
| * The minimum validation rule that was violated. | |
| */ | |
| rule: InvalidParameterMinimumRule; | |
| /** | |
| * The minimum allowed value or length. | |
| */ | |
| minimum: integer; | |
| /** | |
| * The part of the request the field came from (e.g. `body`, `query`). | |
| */ | |
| source?: string; | |
| /** | |
| * A human readable explanation of why the field failed validation. | |
| */ | |
| reason: string; | |
| } | |
| /** | |
| * Minimum-length (or minimum-value) validation rules. | |
| */ | |
| ("InvalidParameterMinimumRule") | |
| enum InvalidParameterMinimumRule { | |
| MinLength: "min_length", | |
| MinDigits: "min_digits", | |
| MinLowercase: "min_lowercase", | |
| MinUppercase: "min_uppercase", | |
| MinSymbols: "min_symbols", | |
| MinItems: "min_items", | |
| Min: "min", | |
| } | |
| /** | |
| * A parameter that failed a maximum-length (or maximum-value) validation rule. | |
| */ | |
| ("InvalidParameterMaximumLength") | |
| model InvalidParameterMaximumLength { | |
| /** | |
| * The name of the field that failed validation. | |
| */ | |
| (Lifecycle.Read) | |
| field: string; | |
| /** | |
| * The maximum validation rule that was violated. | |
| */ | |
| rule: InvalidParameterMaximumRule; | |
| /** | |
| * The maximum allowed value or length. | |
| */ | |
| maximum: integer; | |
| /** | |
| * The part of the request the field came from (e.g. `body`, `query`). | |
| */ | |
| source?: string; | |
| /** | |
| * A human readable explanation of why the field failed validation. | |
| */ | |
| (Lifecycle.Read) | |
| reason: string; | |
| } | |
| /** | |
| * Maximum-length (or maximum-value) validation rules. | |
| */ | |
| ("InvalidParameterMaximumRule") | |
| enum InvalidParameterMaximumRule { | |
| MaxLength: "max_length", | |
| MaxItems: "max_items", | |
| Max: "max", | |
| } | |
| /** | |
| * A parameter whose value was not one of the allowed choices. | |
| */ | |
| ("InvalidParameterChoiceItem") | |
| model InvalidParameterChoiceItem { | |
| /** | |
| * The name of the field that failed validation. | |
| */ | |
| (Lifecycle.Read) | |
| field: string; | |
| /** | |
| * The enum validation rule that was violated. | |
| */ | |
| rule: InvalidParameterChoiceRule; | |
| /** | |
| * A human readable explanation of why the field failed validation. | |
| */ | |
| (Lifecycle.Read) | |
| reason: string; | |
| /** | |
| * The allowed choices for the field. | |
| */ | |
| (Lifecycle.Read) | |
| (1) | |
| choices: unknown[]; | |
| /** | |
| * The part of the request the field came from (e.g. `body`, `query`). | |
| */ | |
| source?: string; | |
| } | |
| /** | |
| * The enum validation rule. | |
| */ | |
| ("InvalidParameterChoiceRule") | |
| enum InvalidParameterChoiceRule { | |
| Enum: "enum", | |
| } | |
| /** | |
| * A parameter that failed a dependent-fields validation rule. | |
| */ | |
| ("InvalidParameterDependentItem") | |
| model InvalidParameterDependentItem { | |
| /** | |
| * The name of the field that failed validation. | |
| */ | |
| field: string; | |
| /** | |
| * The dependent-fields validation rule that was violated. | |
| */ | |
| rule: InvalidParameterDependentRule; | |
| /** | |
| * A human readable explanation of why the field failed validation. | |
| */ | |
| reason: string; | |
| /** | |
| * The fields that this field depends on. | |
| */ | |
| dependents: unknown[]; | |
| /** | |
| * The part of the request the field came from (e.g. `body`, `query`). | |
| */ | |
| source?: string; | |
| } | |
| /** | |
| * The dependent-fields validation rule. | |
| */ | |
| ("InvalidParameterDependentRule") | |
| enum InvalidParameterDependentRule { | |
| DependentFields: "dependent_fields", | |
| } | |