-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodeSamples.yaml
377 lines (377 loc) · 79.2 KB
/
codeSamples.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
overlay: 1.0.0
info:
title: CodeSamples overlay for java target
version: 0.0.0
actions:
- target: $["paths"]["/apps/v2/apps"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetApps"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetAppsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetAppsResponse res = sdk.appsV2().getApps()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.applicationsPage().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/apps/v2/apps"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "CreateApp"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.CreateAppResponse;\nimport dev.hathora.cloud_sdk.models.shared.AppConfig;\nimport dev.hathora.cloud_sdk.models.shared.AuthConfiguration;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n CreateAppResponse res = sdk.appsV2().createApp()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appConfig(AppConfig.builder()\n .authConfiguration(AuthConfiguration.builder()\n .build())\n .appName(\"minecraft\")\n .build())\n .call();\n\n if (res.application().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/apps/v2/apps/{appId}"]["delete"]
update:
"x-codeSamples":
- "lang": "java"
"label": "DeleteApp"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.DeleteAppResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n DeleteAppResponse res = sdk.appsV2().deleteApp()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .call();\n\n // handle response\n }\n}"
- target: $["paths"]["/apps/v2/apps/{appId}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetApp"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetAppResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetAppResponse res = sdk.appsV2().getApp()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .call();\n\n if (res.application().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/apps/v2/apps/{appId}"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "UpdateApp"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.UpdateAppResponse;\nimport dev.hathora.cloud_sdk.models.shared.AppConfig;\nimport dev.hathora.cloud_sdk.models.shared.AuthConfiguration;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n UpdateAppResponse res = sdk.appsV2().updateApp()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .appConfig(AppConfig.builder()\n .authConfiguration(AuthConfiguration.builder()\n .build())\n .appName(\"minecraft\")\n .build())\n .call();\n\n if (res.application().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/auth/v1/{appId}/login/anonymous"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "LoginAnonymous"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.LoginAnonymousResponse;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n LoginAnonymousResponse res = sdk.authV1().loginAnonymous()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .call();\n\n if (res.playerTokenObject().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/auth/v1/{appId}/login/google"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "LoginGoogle"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.LoginGoogleResponse;\nimport dev.hathora.cloud_sdk.models.shared.GoogleIdTokenObject;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n LoginGoogleResponse res = sdk.authV1().loginGoogle()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .googleIdTokenObject(GoogleIdTokenObject.builder()\n .idToken(\"eyJhbGciOiJSUzI1NiIsImtpZCI6ImZkNDhhNzUxMzhkOWQ0OGYwYWE2MzVlZjU2OWM0ZTE5NmY3YWU4ZDYiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiYXpwIjoiODQ4NDEyODI2Nzg4LW00bXNyYjZxNDRkbTJ1ZTNrZ3Z1aTBmcTdrZGE1NWxzLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiYXVkIjoiODQ4NDEyODI2Nzg4LW00bXNyYjZxNDRkbTJ1ZTNrZ3Z1aTBmcTdrZGE1NWxzLmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwic3ViIjoiMTE0NTQyMzMwNzI3MTU2MTMzNzc2IiwiZW1haWwiOiJocGFdkeivmeuzQGdtYWlsLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJhdF9oYXNoIjoidno1NGhhdTNxbnVR\")\n .build())\n .call();\n\n if (res.playerTokenObject().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/auth/v1/{appId}/login/nickname"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "LoginNickname"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.LoginNicknameResponse;\nimport dev.hathora.cloud_sdk.models.shared.NicknameObject;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n LoginNicknameResponse res = sdk.authV1().loginNickname()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .nicknameObject(NicknameObject.builder()\n .nickname(\"squiddytwoshoes\")\n .build())\n .call();\n\n if (res.playerTokenObject().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/billing/v1/balance"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetBalance"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetBalanceResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetBalanceResponse res = sdk.billingV1().getBalance()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.number().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/billing/v1/customerportalurl"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "InitStripeCustomerPortalUrl"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.InitStripeCustomerPortalUrlResponse;\nimport dev.hathora.cloud_sdk.models.shared.CustomerPortalUrl;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n InitStripeCustomerPortalUrlResponse res = sdk.billingV1().initStripeCustomerPortalUrl()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .customerPortalUrl(CustomerPortalUrl.builder()\n .returnUrl(\"https://smart-puppet.biz/\")\n .build())\n .call();\n\n if (res.string().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/billing/v1/invoices"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetInvoices"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetInvoicesResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetInvoicesResponse res = sdk.billingV1().getInvoices()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.invoices().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/billing/v1/paymentmethod"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetPaymentMethod"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetPaymentMethodResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetPaymentMethodResponse res = sdk.billingV1().getPaymentMethod()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.paymentMethod().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/billing/v1/upcoming/items"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetUpcomingInvoiceItems"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetUpcomingInvoiceItemsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetUpcomingInvoiceItemsResponse res = sdk.billingV1().getUpcomingInvoiceItems()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.invoiceItemPage().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/billing/v1/upcoming/total"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetUpcomingInvoiceTotal"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetUpcomingInvoiceTotalResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetUpcomingInvoiceTotalResponse res = sdk.billingV1().getUpcomingInvoiceTotal()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.object().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/builds/v3/builds"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetBuilds"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetBuildsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetBuildsResponse res = sdk.buildsV3().getBuilds()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.buildsV3Page().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/builds/v3/builds"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "CreateBuild"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.CreateBuildResponse;\nimport dev.hathora.cloud_sdk.models.shared.CreateMultipartBuildParams;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n CreateBuildResponse res = sdk.buildsV3().createBuild()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .createMultipartBuildParams(CreateMultipartBuildParams.builder()\n .buildSizeInBytes(5387.85d)\n .buildId(\"bld-6d4c6a71-2d75-4b42-94e1-f312f57f33c5\")\n .buildTag(\"0.1.14-14c793\")\n .build())\n .call();\n\n if (res.createdBuildV3WithMultipartUrls().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/builds/v3/builds/{buildId}"]["delete"]
update:
"x-codeSamples":
- "lang": "java"
"label": "DeleteBuild"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.DeleteBuildResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n DeleteBuildResponse res = sdk.buildsV3().deleteBuild()\n .buildId(\"bld-6d4c6a71-2d75-4b42-94e1-f312f57f33c5\")\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.deletedBuild().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/builds/v3/builds/{buildId}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetBuild"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetBuildResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetBuildResponse res = sdk.buildsV3().getBuild()\n .buildId(\"bld-6d4c6a71-2d75-4b42-94e1-f312f57f33c5\")\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.buildV3().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/builds/v3/builds/{buildId}/run"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "RunBuild"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.RunBuildResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n RunBuildResponse res = sdk.buildsV3().runBuild()\n .buildId(\"bld-6d4c6a71-2d75-4b42-94e1-f312f57f33c5\")\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.responseStream().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/deployments/v3/apps/{appId}/deployments"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetDeployments"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetDeploymentsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetDeploymentsResponse res = sdk.deploymentsV3().getDeployments()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .deploymentTag(\"alpha\")\n .call();\n\n if (res.deploymentsV3Page().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/deployments/v3/apps/{appId}/deployments"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "CreateDeployment"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.CreateDeploymentResponse;\nimport dev.hathora.cloud_sdk.models.shared.DeploymentConfigV3;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport dev.hathora.cloud_sdk.models.shared.TransportType;\nimport java.lang.Exception;\nimport java.util.List;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n CreateDeploymentResponse res = sdk.deploymentsV3().createDeployment()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .deploymentConfigV3(DeploymentConfigV3.builder()\n .idleTimeoutEnabled(false)\n .env(List.of(\n ))\n .roomsPerProcess(3)\n .transportType(TransportType.TCP)\n .containerPort(4000)\n .requestedMemoryMB(1024d)\n .requestedCPU(0.5d)\n .buildId(\"bld-6d4c6a71-2d75-4b42-94e1-f312f57f33c5\")\n .deploymentTag(\"alpha\")\n .additionalContainerPorts(List.of(\n ))\n .experimentalRequestedGPU(1d)\n .build())\n .call();\n\n if (res.deploymentV3().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/deployments/v3/apps/{appId}/deployments/latest"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetLatestDeployment"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetLatestDeploymentResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetLatestDeploymentResponse res = sdk.deploymentsV3().getLatestDeployment()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .call();\n\n if (res.deploymentV3().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/deployments/v3/apps/{appId}/deployments/{deploymentId}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetDeployment"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetDeploymentResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetDeploymentResponse res = sdk.deploymentsV3().getDeployment()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .deploymentId(\"dep-6d4c6a71-2d75-4b42-94e1-f312f57f33c5\")\n .call();\n\n if (res.deploymentV3().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/discovery/v2/ping"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetPingServiceEndpoints"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.operations.GetPingServiceEndpointsResponse;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetPingServiceEndpointsResponse res = sdk.discoveryV2().getPingServiceEndpoints()\n .call();\n\n if (res.pingEndpoints().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/fleets/v1/fleets"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetFleets"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetFleetsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetFleetsResponse res = sdk.fleetsV1().getFleets()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.fleetsPage().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/fleets/v1/fleets/{fleetId}/regions/{region}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetFleetRegion"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetFleetRegionResponse;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetFleetRegionResponse res = sdk.fleetsV1().getFleetRegion()\n .fleetId(\"<id>\")\n .region(Region.SAO_PAULO)\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.fleetRegion().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/fleets/v1/fleets/{fleetId}/regions/{region}"]["put"]
update:
"x-codeSamples":
- "lang": "java"
"label": "UpdateFleetRegion"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.UpdateFleetRegionRequest;\nimport dev.hathora.cloud_sdk.models.operations.UpdateFleetRegionResponse;\nimport dev.hathora.cloud_sdk.models.shared.FleetRegionConfig;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n UpdateFleetRegionRequest req = UpdateFleetRegionRequest.builder()\n .fleetId(\"<id>\")\n .region(Region.SINGAPORE)\n .fleetRegionConfig(FleetRegionConfig.builder()\n .cloudMinVcpus(511402)\n .build())\n .build();\n\n UpdateFleetRegionResponse res = sdk.fleetsV1().updateFleetRegion()\n .request(req)\n .call();\n\n // handle response\n }\n}"
- target: $["paths"]["/fleets/v1/fleets/{fleetId}/regions/{region}/metrics"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetFleetMetrics"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetFleetMetricsRequest;\nimport dev.hathora.cloud_sdk.models.operations.GetFleetMetricsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetFleetMetricsRequest req = GetFleetMetricsRequest.builder()\n .fleetId(\"<id>\")\n .region(Region.LONDON)\n .build();\n\n GetFleetMetricsResponse res = sdk.fleetsV1().getFleetMetrics()\n .request(req)\n .call();\n\n if (res.fleetMetricsData().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/lobby/v3/{appId}/create"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "CreateLobby"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.CreateLobbyRequest;\nimport dev.hathora.cloud_sdk.models.operations.CreateLobbyResponse;\nimport dev.hathora.cloud_sdk.models.operations.CreateLobbySecurity;\nimport dev.hathora.cloud_sdk.models.shared.CreateLobbyV3Params;\nimport dev.hathora.cloud_sdk.models.shared.LobbyVisibility;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n CreateLobbyRequest req = CreateLobbyRequest.builder()\n .createLobbyV3Params(CreateLobbyV3Params.builder()\n .visibility(LobbyVisibility.PRIVATE)\n .region(Region.SEATTLE)\n .roomConfig(\"{\\\"name\\\":\\\"my-room\\\"}\")\n .build())\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .shortCode(\"LFG4\")\n .roomId(\"2swovpy1fnunu\")\n .build();\n\n CreateLobbyResponse res = sdk.lobbiesV3().createLobby()\n .request(req)\n .security(CreateLobbySecurity.builder()\n .playerAuth(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .call();\n\n if (res.lobbyV3().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/lobby/v3/{appId}/info/roomid/{roomId}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetLobbyInfoByRoomId"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetLobbyInfoByRoomIdResponse;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetLobbyInfoByRoomIdResponse res = sdk.lobbiesV3().getLobbyInfoByRoomId()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .roomId(\"2swovpy1fnunu\")\n .call();\n\n if (res.lobbyV3().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/lobby/v3/{appId}/info/shortcode/{shortCode}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetLobbyInfoByShortCode"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetLobbyInfoByShortCodeResponse;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetLobbyInfoByShortCodeResponse res = sdk.lobbiesV3().getLobbyInfoByShortCode()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .shortCode(\"LFG4\")\n .call();\n\n if (res.lobbyV3().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/lobby/v3/{appId}/list/public"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "ListActivePublicLobbies"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.ListActivePublicLobbiesResponse;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n ListActivePublicLobbiesResponse res = sdk.lobbiesV3().listActivePublicLobbies()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .region(Region.LOS_ANGELES)\n .call();\n\n if (res.lobbyV3s().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/logs/v1/{appId}/process/{processId}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetLogsForProcess"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetLogsForProcessRequest;\nimport dev.hathora.cloud_sdk.models.operations.GetLogsForProcessResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetLogsForProcessRequest req = GetLogsForProcessRequest.builder()\n .processId(\"cbfcddd2-0006-43ae-996c-995fff7bed2e\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .tailLines(100)\n .build();\n\n GetLogsForProcessResponse res = sdk.logsV1().getLogsForProcess()\n .request(req)\n .call();\n\n if (res.responseStream().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/logs/v1/{appId}/process/{processId}/download"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "DownloadLogForProcess"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.DownloadLogForProcessResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n DownloadLogForProcessResponse res = sdk.logsV1().downloadLogForProcess()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .processId(\"cbfcddd2-0006-43ae-996c-995fff7bed2e\")\n .call();\n\n if (res.responseStream().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/management/v1/sendverificationemail"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "SendVerificationEmail"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.SendVerificationEmailResponse;\nimport dev.hathora.cloud_sdk.models.shared.VerificationEmailRequest;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n VerificationEmailRequest req = VerificationEmailRequest.builder()\n .userId(\"<id>\")\n .build();\n\n SendVerificationEmailResponse res = sdk.managementV1().sendVerificationEmail()\n .request(req)\n .call();\n\n if (res.verificationEmailSuccess().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/orgs/v1"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetOrgs"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetOrgsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetOrgsResponse res = sdk.organizationsV1().getOrgs()\n .call();\n\n if (res.orgsPage().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/orgs/v1/metadata/usageLimits"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetUsageLimits"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetUsageLimitsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetUsageLimitsResponse res = sdk.organizationsV1().getUsageLimits()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.usageLimits().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/orgs/v1/user/invites/pending"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetUserPendingInvites"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetUserPendingInvitesResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetUserPendingInvitesResponse res = sdk.organizationsV1().getUserPendingInvites()\n .call();\n\n if (res.pendingOrgInvitesPage().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/orgs/v1/{orgId}/invites"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "UpdateUserInvite"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.UpdateUserInviteResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport dev.hathora.cloud_sdk.models.shared.UpdateUserInvite;\nimport dev.hathora.cloud_sdk.models.shared.UpdateUserInviteScopes;\nimport dev.hathora.cloud_sdk.models.shared.UserRole;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n UpdateUserInviteResponse res = sdk.organizationsV1().updateUserInvite()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .updateUserInvite(UpdateUserInvite.builder()\n .scopes(UpdateUserInviteScopes.of(UserRole.VIEWER))\n .userEmail(\"[email protected]\")\n .build())\n .call();\n\n if (res.boolean_().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/orgs/v1/{orgId}/invites"]["put"]
update:
"x-codeSamples":
- "lang": "java"
"label": "InviteUser"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.InviteUserResponse;\nimport dev.hathora.cloud_sdk.models.shared.CreateUserInvite;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n InviteUserResponse res = sdk.organizationsV1().inviteUser()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .createUserInvite(CreateUserInvite.builder()\n .userEmail(\"[email protected]\")\n .build())\n .call();\n\n if (res.pendingOrgInvite().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/orgs/v1/{orgId}/invites/accept"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "AcceptInvite"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.AcceptInviteResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n AcceptInviteResponse res = sdk.organizationsV1().acceptInvite()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n // handle response\n }\n}"
- target: $["paths"]["/orgs/v1/{orgId}/invites/pending"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetOrgPendingInvites"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetOrgPendingInvitesResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetOrgPendingInvitesResponse res = sdk.organizationsV1().getOrgPendingInvites()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.pendingOrgInvitesPage().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/orgs/v1/{orgId}/invites/reject"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "RejectInvite"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.RejectInviteResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n RejectInviteResponse res = sdk.organizationsV1().rejectInvite()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n // handle response\n }\n}"
- target: $["paths"]["/orgs/v1/{orgId}/invites/rescind"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "RescindInvite"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.RescindInviteResponse;\nimport dev.hathora.cloud_sdk.models.shared.RescindUserInvite;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n RescindInviteResponse res = sdk.organizationsV1().rescindInvite()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .rescindUserInvite(RescindUserInvite.builder()\n .userEmail(\"[email protected]\")\n .build())\n .call();\n\n // handle response\n }\n}"
- target: $["paths"]["/orgs/v1/{orgId}/members"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetOrgMembers"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetOrgMembersResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetOrgMembersResponse res = sdk.organizationsV1().getOrgMembers()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.orgMembersPage().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/processes/v3/apps/{appId}/processes/count"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetProcessesCountExperimental"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetProcessesCountExperimentalResponse;\nimport dev.hathora.cloud_sdk.models.shared.ProcessStatus;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\nimport java.util.List;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetProcessesCountExperimentalResponse res = sdk.processesV3().getProcessesCountExperimental()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .status(List.of(\n ProcessStatus.DRAINING))\n .region(List.of(\n Region.SINGAPORE))\n .call();\n\n if (res.object().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/processes/v3/apps/{appId}/processes/latest"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetLatestProcesses"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetLatestProcessesResponse;\nimport dev.hathora.cloud_sdk.models.shared.ProcessStatus;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\nimport java.util.List;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetLatestProcessesResponse res = sdk.processesV3().getLatestProcesses()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .status(List.of(\n ProcessStatus.STOPPED))\n .region(List.of(\n Region.FRANKFURT))\n .call();\n\n if (res.processV3s().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/processes/v3/apps/{appId}/processes/process/{processId}/metrics"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetProcessMetrics"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetProcessMetricsRequest;\nimport dev.hathora.cloud_sdk.models.operations.GetProcessMetricsResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetProcessMetricsRequest req = GetProcessMetricsRequest.builder()\n .processId(\"cbfcddd2-0006-43ae-996c-995fff7bed2e\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetProcessMetricsResponse res = sdk.processesV3().getProcessMetrics()\n .request(req)\n .call();\n\n if (res.processMetricsData().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/processes/v3/apps/{appId}/processes/regions/{region}"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "CreateProcess"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.CreateProcessResponse;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n CreateProcessResponse res = sdk.processesV3().createProcess()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .region(Region.SAO_PAULO)\n .call();\n\n if (res.processV3().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/processes/v3/apps/{appId}/processes/{processId}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetProcess"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetProcessResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetProcessResponse res = sdk.processesV3().getProcess()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .processId(\"cbfcddd2-0006-43ae-996c-995fff7bed2e\")\n .call();\n\n if (res.processV3().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/processes/v3/apps/{appId}/processes/{processId}/stop"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "StopProcess"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.StopProcessResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n StopProcessResponse res = sdk.processesV3().stopProcess()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .processId(\"cbfcddd2-0006-43ae-996c-995fff7bed2e\")\n .call();\n\n // handle response\n }\n}"
- target: $["paths"]["/rooms/v2/{appId}/connectioninfo/{roomId}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetConnectionInfo"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetConnectionInfoResponse;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetConnectionInfoResponse res = sdk.roomsV2().getConnectionInfo()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .roomId(\"2swovpy1fnunu\")\n .call();\n\n if (res.connectionInfoV2().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/rooms/v2/{appId}/create"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "CreateRoom"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.CreateRoomResponse;\nimport dev.hathora.cloud_sdk.models.shared.CreateRoomParams;\nimport dev.hathora.cloud_sdk.models.shared.Region;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\nimport java.util.List;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n CreateRoomResponse res = sdk.roomsV2().createRoom()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .roomId(\"2swovpy1fnunu\")\n .createRoomParams(CreateRoomParams.builder()\n .region(Region.DALLAS)\n .deploymentId(\"dep-6d4c6a71-2d75-4b42-94e1-f312f57f33c5\")\n .clientIPs(List.of(\n \"123.123.123.123\"))\n .roomConfig(\"{\\\"name\\\":\\\"my-room\\\"}\")\n .build())\n .call();\n\n if (res.roomConnectionData().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/rooms/v2/{appId}/destroy/{roomId}"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "DestroyRoom"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.DestroyRoomResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n DestroyRoomResponse res = sdk.roomsV2().destroyRoom()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .roomId(\"2swovpy1fnunu\")\n .call();\n\n // handle response\n }\n}"
- target: $["paths"]["/rooms/v2/{appId}/info/{roomId}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetRoomInfo"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetRoomInfoResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetRoomInfoResponse res = sdk.roomsV2().getRoomInfo()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .roomId(\"2swovpy1fnunu\")\n .call();\n\n if (res.room().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/rooms/v2/{appId}/list/{processId}/active"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetActiveRoomsForProcess"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetActiveRoomsForProcessResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetActiveRoomsForProcessResponse res = sdk.roomsV2().getActiveRoomsForProcess()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .processId(\"cbfcddd2-0006-43ae-996c-995fff7bed2e\")\n .call();\n\n if (res.roomWithoutAllocations().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/rooms/v2/{appId}/list/{processId}/inactive"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetInactiveRoomsForProcess"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetInactiveRoomsForProcessResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetInactiveRoomsForProcessResponse res = sdk.roomsV2().getInactiveRoomsForProcess()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .processId(\"cbfcddd2-0006-43ae-996c-995fff7bed2e\")\n .call();\n\n if (res.roomWithoutAllocations().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/rooms/v2/{appId}/resume/{roomId}"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "ResumeRoom"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.ResumeRoomResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n ResumeRoomResponse res = sdk.roomsV2().resumeRoom()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .roomId(\"2swovpy1fnunu\")\n .call();\n\n if (res.roomAllocationData().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/rooms/v2/{appId}/update/{roomId}"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "UpdateRoomConfig"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.UpdateRoomConfigResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport dev.hathora.cloud_sdk.models.shared.UpdateRoomConfigParams;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n UpdateRoomConfigResponse res = sdk.roomsV2().updateRoomConfig()\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .roomId(\"2swovpy1fnunu\")\n .updateRoomConfigParams(UpdateRoomConfigParams.builder()\n .roomConfig(\"{\\\"name\\\":\\\"my-room\\\"}\")\n .build())\n .call();\n\n // handle response\n }\n}"
- target: $["paths"]["/tokens/v1/orgs/{orgId}"]["get"]
update:
"x-codeSamples":
- "lang": "java"
"label": "GetOrgTokens"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.GetOrgTokensResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n GetOrgTokensResponse res = sdk.tokensV1().getOrgTokens()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .call();\n\n if (res.listOrgTokens().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/tokens/v1/orgs/{orgId}/create"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "CreateOrgToken"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.CreateOrgTokenResponse;\nimport dev.hathora.cloud_sdk.models.shared.CreateOrgToken;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n CreateOrgTokenResponse res = sdk.tokensV1().createOrgToken()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .createOrgToken(CreateOrgToken.builder()\n .name(\"ci-token\")\n .build())\n .call();\n\n if (res.createdOrgToken().isPresent()) {\n // handle response\n }\n }\n}"
- target: $["paths"]["/tokens/v1/orgs/{orgId}/tokens/{orgTokenId}/revoke"]["post"]
update:
"x-codeSamples":
- "lang": "java"
"label": "RevokeOrgToken"
"source": "package hello.world;\n\nimport dev.hathora.cloud_sdk.HathoraCloud;\nimport dev.hathora.cloud_sdk.models.errors.ApiError;\nimport dev.hathora.cloud_sdk.models.operations.RevokeOrgTokenResponse;\nimport dev.hathora.cloud_sdk.models.shared.Security;\nimport java.lang.Exception;\n\npublic class Application {\n\n public static void main(String[] args) throws ApiError, Exception {\n\n HathoraCloud sdk = HathoraCloud.builder()\n .security(Security.builder()\n .hathoraDevToken(\"<YOUR_BEARER_TOKEN_HERE>\")\n .build())\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .appId(\"app-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .build();\n\n RevokeOrgTokenResponse res = sdk.tokensV1().revokeOrgToken()\n .orgId(\"org-6f706e83-0ec1-437a-9a46-7d4281eb2f39\")\n .orgTokenId(\"org-token-af469a92-5b45-4565-b3c4-b79878de67d2\")\n .call();\n\n if (res.boolean_().isPresent()) {\n // handle response\n }\n }\n}"