11"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
22
33from .sdkconfiguration import SDKConfiguration
4+ from enum import Enum
45from speakeasy import utils
56from speakeasy .models import errors , operations , shared
67from typing import Optional
78
9+ class DownloadSchemaAcceptEnum (str , Enum ):
10+ APPLICATION_JSON = "application/json"
11+ APPLICATION_X_YAML = "application/x-yaml"
12+
13+ class DownloadSchemaRevisionAcceptEnum (str , Enum ):
14+ APPLICATION_JSON = "application/json"
15+ APPLICATION_X_YAML = "application/x-yaml"
16+
817class Schemas :
918 r"""REST APIs for managing Schema entities"""
1019 sdk_configuration : SDKConfiguration
@@ -41,13 +50,16 @@ def delete_schema(self, request: operations.DeleteSchemaRequest) -> operations.D
4150 return res
4251
4352
44- def download_schema (self , request : operations .DownloadSchemaRequest ) -> operations .DownloadSchemaResponse :
53+ def download_schema (self , request : operations .DownloadSchemaRequest , accept_header_override : Optional [ DownloadSchemaAcceptEnum ] = None ) -> operations .DownloadSchemaResponse :
4554 r"""Download the latest schema for a particular apiID."""
4655 base_url = utils .template_url (* self .sdk_configuration .get_server_details ())
4756
4857 url = utils .generate_url (operations .DownloadSchemaRequest , base_url , '/v1/apis/{apiID}/version/{versionID}/schema/download' , request )
4958 headers = {}
50- headers ['Accept' ] = 'application/json;q=1, application/x-yaml;q=0'
59+ if accept_header_override is not None :
60+ headers ['Accept' ] = accept_header_override .value
61+ else :
62+ headers ['Accept' ] = 'application/json;q=1, application/x-yaml;q=0'
5163 headers ['user-agent' ] = f'speakeasy-sdk/{ self .sdk_configuration .language } { self .sdk_configuration .sdk_version } { self .sdk_configuration .gen_version } { self .sdk_configuration .openapi_doc_version } '
5264
5365 client = self .sdk_configuration .security_client
@@ -74,13 +86,16 @@ def download_schema(self, request: operations.DownloadSchemaRequest) -> operatio
7486 return res
7587
7688
77- def download_schema_revision (self , request : operations .DownloadSchemaRevisionRequest ) -> operations .DownloadSchemaRevisionResponse :
89+ def download_schema_revision (self , request : operations .DownloadSchemaRevisionRequest , accept_header_override : Optional [ DownloadSchemaRevisionAcceptEnum ] = None ) -> operations .DownloadSchemaRevisionResponse :
7890 r"""Download a particular schema revision for an Api."""
7991 base_url = utils .template_url (* self .sdk_configuration .get_server_details ())
8092
8193 url = utils .generate_url (operations .DownloadSchemaRevisionRequest , base_url , '/v1/apis/{apiID}/version/{versionID}/schema/{revisionID}/download' , request )
8294 headers = {}
83- headers ['Accept' ] = 'application/json;q=1, application/x-yaml;q=0'
95+ if accept_header_override is not None :
96+ headers ['Accept' ] = accept_header_override .value
97+ else :
98+ headers ['Accept' ] = 'application/json;q=1, application/x-yaml;q=0'
8499 headers ['user-agent' ] = f'speakeasy-sdk/{ self .sdk_configuration .language } { self .sdk_configuration .sdk_version } { self .sdk_configuration .gen_version } { self .sdk_configuration .openapi_doc_version } '
85100
86101 client = self .sdk_configuration .security_client
0 commit comments