Commit 4c6599c
authored
Propagate Request Headers through API Client (#135)
## Changes
Based on changes in
databricks/databricks-sdk-go#572.
This PR adds initial support for headers in ApiClient.java. The `*Impl`
classes, when making a request, will construct a map of headers to be
included in the request. These are passed through a new parameter in
each of GET/PUT/POST/PATCH/DELETE.
In the future, to support dynamic headers, we can modify our codegen
template to add those fields to the headers map before calling the
ApiClient.
Alternatives considered:
* **Adding headers in request objects directly**: this would not require
any change in the ApiClient interface. Instead, we would introduce a new
annotation for headers, much like what we do for query parameters, and
reflectively scan the fields of each request object. We could do this,
but for headers that have a fixed value (like `Content-Type` and
`Accept`), these fields would essentially be private final fields that
we could iterate through. Users can never interact with these fields, so
it seems a bit unusual to have them in the request structure, a public
interface.
## Tests
<!-- How is this tested? -->1 parent 1d47a74 commit 4c6599c
File tree
92 files changed
+1962
-858
lines changed- .codegen
- databricks-sdk-java/src
- main/java/com/databricks/sdk
- core
- service
- billing
- catalog
- compute
- files
- iam
- jobs
- ml
- oauth2
- pipelines
- provisioning
- serving
- settings
- sharing
- sql
- workspace
- test/java/com/databricks/sdk/core
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
92 files changed
+1962
-858
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | | - | |
31 | | - | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | | - | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
Lines changed: 46 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 16 | + | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
88 | | - | |
| 86 | + | |
89 | 87 | | |
90 | | - | |
| 88 | + | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
96 | | - | |
97 | 94 | | |
98 | 95 | | |
99 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
100 | 107 | | |
101 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
102 | 112 | | |
103 | 113 | | |
104 | | - | |
| 114 | + | |
105 | 115 | | |
106 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
107 | 120 | | |
108 | 121 | | |
109 | | - | |
| 122 | + | |
| 123 | + | |
110 | 124 | | |
111 | | - | |
| 125 | + | |
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
115 | 129 | | |
116 | 130 | | |
117 | 131 | | |
118 | 132 | | |
119 | | - | |
120 | | - | |
| 133 | + | |
| 134 | + | |
121 | 135 | | |
122 | 136 | | |
123 | | - | |
| 137 | + | |
124 | 138 | | |
125 | | - | |
| 139 | + | |
126 | 140 | | |
127 | 141 | | |
128 | 142 | | |
129 | 143 | | |
130 | 144 | | |
131 | | - | |
| 145 | + | |
132 | 146 | | |
133 | | - | |
| 147 | + | |
134 | 148 | | |
135 | 149 | | |
136 | 150 | | |
137 | 151 | | |
138 | 152 | | |
139 | | - | |
| 153 | + | |
140 | 154 | | |
141 | | - | |
| 155 | + | |
142 | 156 | | |
143 | 157 | | |
144 | 158 | | |
145 | 159 | | |
146 | 160 | | |
147 | | - | |
| 161 | + | |
148 | 162 | | |
149 | | - | |
| 163 | + | |
150 | 164 | | |
151 | 165 | | |
152 | 166 | | |
153 | 167 | | |
154 | 168 | | |
155 | | - | |
| 169 | + | |
156 | 170 | | |
157 | | - | |
| 171 | + | |
158 | 172 | | |
159 | 173 | | |
160 | 174 | | |
161 | 175 | | |
162 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
163 | 185 | | |
164 | 186 | | |
165 | 187 | | |
| |||
177 | 199 | | |
178 | 200 | | |
179 | 201 | | |
180 | | - | |
181 | 202 | | |
182 | 203 | | |
183 | 204 | | |
| |||
Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments