1
1
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2
2
3
3
from .sdkconfiguration import SDKConfiguration
4
+ from enum import Enum
4
5
from speakeasy import utils
5
6
from speakeasy .models import errors , operations , shared
6
7
from typing import Optional
7
8
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
+
8
17
class Schemas :
9
18
r"""REST APIs for managing Schema entities"""
10
19
sdk_configuration : SDKConfiguration
@@ -41,13 +50,16 @@ def delete_schema(self, request: operations.DeleteSchemaRequest) -> operations.D
41
50
return res
42
51
43
52
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 :
45
54
r"""Download the latest schema for a particular apiID."""
46
55
base_url = utils .template_url (* self .sdk_configuration .get_server_details ())
47
56
48
57
url = utils .generate_url (operations .DownloadSchemaRequest , base_url , '/v1/apis/{apiID}/version/{versionID}/schema/download' , request )
49
58
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'
51
63
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 } '
52
64
53
65
client = self .sdk_configuration .security_client
@@ -74,13 +86,16 @@ def download_schema(self, request: operations.DownloadSchemaRequest) -> operatio
74
86
return res
75
87
76
88
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 :
78
90
r"""Download a particular schema revision for an Api."""
79
91
base_url = utils .template_url (* self .sdk_configuration .get_server_details ())
80
92
81
93
url = utils .generate_url (operations .DownloadSchemaRevisionRequest , base_url , '/v1/apis/{apiID}/version/{versionID}/schema/{revisionID}/download' , request )
82
94
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'
84
99
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 } '
85
100
86
101
client = self .sdk_configuration .security_client
0 commit comments